private void renderElementVisibilityDependencyRules(Form f, StringOutput sb) {
List rules = f.getVisibilityDependsOnSelectionRules();
Iterator iter = rules.iterator();
while (iter.hasNext()) {
VisibilityDependsOnSelectionRule rule = (VisibilityDependsOnSelectionRule) iter.next();
FormElement dependentElement = rule.getDependentElement();
SelectionElement selection = rule.getSelectionElement();
String resetValueOrig = rule.getResetValue();
String resetValue = null;
if (resetValueOrig != null) {
// quote return caracters to fill into js variable
resetValue = resetValueOrig.replaceAll("\n", "\\\\n");
resetValue = resetValue.replaceAll("\r", "\\\\n");
}
sb.append("b_form_updateFormElementVisibility('")
.append(f.getComponentName())
.append("','")
.append(selection.getName())
.append("','")
.append(dependentElement.getName())
.append("','")
.append(rule.getVisibilityRuleValue())
.append("',")
.append(String.valueOf(rule.isVisibilityRuleResult()))
.append(",\"")