Hi,
I have a requirement to dynamically allocate the help and labels for
fields in a repeater. My solution, uses jx templates to set fi:help and
fi:label, like so:
<ft:repeater-widget id="style_flds">
<ft:widget id="value">
<fi:label>
<jx:out
value="${form.getChild('styles').getRow(style_idx).getChild('style_flds').getRow(repeaterLoop.index).getChild('label').value}"
/>
</fi:label>
<fi:styling
type="${form.getChild('styles').getRow(style_idx).getChild('style_flds').getRow(repeaterLoop.index).getChild('fld_type').value}"
/>
<fi:help>
<jx:out
value="${form.getChild('styles').getRow(style_idx).getChild('style_flds').getRow(repeaterLoop.index).getChild('help').value}"
/>
</fi:help>
</ft:widget>
</ft:repeater-widget>
This is a hack. Normally I would be fine with this, but as you can
probably guess we are using 2.1.7 CForms. My question is, if we upgrade
and get all ajaxy, what is the likelihood my hack will continue to work?
Another question, for the development team, has anyone thought about being
able to dynamically set labels in the definition? It seems like a rather
onerous assumption that ever field in a repeater will be labelled the same
way. What would be nice would be able to set state, label and headings in
the definition (where it belongs) using javascript. For example:
<fd:field id="value">
<fd:datatype base="string" />
<fd:state>
<fd:javascript>
if (blah) return(WidgetState.ACTIVE);
else return(WidgetState.INVISIBLE);
</fd:javascript>
<fd:state>
<fd:label>
<fd:javascript>
if (blah) return("First label");
else return("Second label");
</fd:javascript>
</fd:label>
</fd:field>
Anyway, my two cents.
Cheers.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]