-
Notifications
You must be signed in to change notification settings - Fork 563
Closed
Labels
bugIdentified bug which needs a fixIdentified bug which needs a fix
Milestone
Description
I'm trying to use QueryBuilder in a JSF application. By default JSF prepends the container(s) elements to child elements using colons, which jQuery interprets as a selector.
<div id="MyForm:RuleTabs:builder" class="query-builder form-inline">
<dl id="MyForm:RuleTabs:builder_group_0" class="rules-group-container">
<dt class="rules-group-header">
...
<div class="btn-group group-conditions">
...
<dd class="rules-group-body">
<ul class="rules-list">
<li id="MyForm:RuleTabs:builder_rule_0" class="rule-container">
...
<div class="rule-value-container">
<input class="form-control" type="text" name="MyForm:RuleTabs:builder_rule_0_value_0">
</div>
</li>
</ul>
</dd>
...
</div>
</dt>
</dl>
</div>
The inclusion of the colons in the element IDs prevents get/setRules from being able to retrieve/set rule values properly. The affected code appears to be in query-builder.js, in the getRuleValue/setRuleValue function, where the values of the input controls are retrieved/applied using something similar to: $value.find('[name='+ name +']').val()
. When name contains colons (or other reserved selector characters), the find will fail.
This issue could be avoided, if the get/set rules escaped the rule element ids before referencing the rule's input control.
Metadata
Metadata
Assignees
Labels
bugIdentified bug which needs a fixIdentified bug which needs a fix