On 19.07.2004 10:30, Robin Wyles wrote:
There is a union widget available in CForms. I already thought about implementing the car selector sample via union widgets, but that's a bit difficult as the cases are dynamic though not impossible:
Have you any ideas how one might go about making cases dynamic? I am currently trying to work this out myself...
No, not really dynamic. You must know all cases and have one struct for every case.
More specifically I would like to be able to dynamically build the contents of the <fd:struct> tags, and then use binding to pre-populate the widget values.
It might work when generating the form definition on the fly. But pre-populating fd:structs from a list of cases sounds like the already existing Form Model GUI sample.
<fd:class id="typeList-class"> <fd:widgets> ... all the widgets ... </fd:widgets> </fd:class>
<fd:field id="makesList"> ... a field with the "Make" selection list ... </fd:field>
<fd:union id="typeList-union" case="makesList"> <fd:widgets> <fd:struct id="make1"> <fd:widgets> <fd:new id="typeList-class"/> </fd:widgets> </fd:struct> <fd:struct id="make2"> <fd:widgets> <fd:new id="typeList-class"/> </fd:widgets> </fd:struct> <fd:struct id="make3"> <fd:widgets> <fd:new id="typeList-class"/> </fd:widgets> </fd:struct> ... </fd:widgets> </fd:union>
As you can see you need one fd:struct for each case of the makesList. There is already agreement that the union widget needs a fd:case like in binding and template instead of the unconvenient fd:struct like above. Also fd:case should allow "real" expressions instead of pure string matching. But both is not implemented until now.
I'm sorry but could you clarify this - do you know if "real" expressions are supported in case matching yet?
�hm, I think this question I have already answered.
Joerg
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
