Joerg,
On 19 Jul 2004, at 08:48, Joerg Heinicke wrote:
On 16.07.2004 11:38, Stephane Delort wrote:
I have a form with selection lists, just as the car-selector sample.
I would like to display the list of "Type" to be displayed only once a
"Make" had been choosed.
I see two solution for this :
1 : could be cool if I could hide widgets in my flowscript withn something
like :
var form = new Form("forms/my_form.xml");
form.lookupWidget("makesList").setValue( 0);
form.lookupwidget("typeList").hide(); // or // form.hideWidget
("typeList");
I saw on another issue that we could have problems with validating once the
form is submitted without all choices.
2 : do 3 Pages
1st : only displaying the "MakeList" form;
2nd : displaying "typeList" and "typeList";
3rd : displaying the whole form;
This solution is kinda ugly becaus I will have to make more then one
form template and form definition as well.
If any one got a proposal ...
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... 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.
<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?
Thanks,
Robin
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
