cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephane Delort" <>
Subject Antwort: Forms with "conditional" parts
Date Tue, 24 Aug 2004 15:35:45 GMT

Hi Bart,

I guess you should have a look at classes, struct and unions to do this
At least to have a clear definition file.

To get started, you could have  as definition file :

<class myclass>
   <field OptionXYZ>
        <item x>
        <item y>
        <item z>
   <union based on the values of the OptionXYZ field>
    <struct fieldAandboolean>
       <field field a>
       <boolenafield fieldB>
    <struct WhenYIsSelected>
       <new class myclass>   <!-- recursive creation is I understdood the
ascii art the right way-->
    <struct whenZIsSelected>
       <field fieldB>
       <field fieldC>

<struct basestruct>
  <new myclass>                  <!-- as a new instnce of a class is always
in a container widget-->

You will understand that this definition filewas made quickly and the
syntax is not correct.
Thus, base ideas are here.

hope this helps,

Bitte antworten an

An:   <>

Thema:    Forms with "conditional" parts


I need to create a form on which a user can select some option, and
depending on that option, needs to fill in some other fields. For

(*) option X
   field A [_______________}
   [X] some boolean

( ) option Y
   upload widget [_______________________] [browse...]
   ( ) some selection list
   (*) ...
   ( ) ...

( ) option Z
   field B [________________]
   field C [________________]

I the sample above (I hope that the ASCII art is clear), I've selected
option X, which means that I need to fill in "field A" and "some
boolean". When I've selection option X, I don't want to validate any
children under "Option Y" and "Option Z". What would be the best way to
do this? Do I need to write my own widget for that?


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message