cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bart Molenkamp" <b.molenk...@bizzdesign.nl>
Subject RE: Antwort: Forms with "conditional" parts
Date Wed, 25 Aug 2004 08:33:48 GMT
Thanks, I've got it working using unions and structs now. :)

-----Original Message-----
From: Stephane Delort [mailto:Stephane.Delort@edag.de] 
Sent: Tuesday, August 24, 2004 5:36 PM
To: users@cocoon.apache.org
Subject: Antwort: Forms with "conditional" parts



Hi Bart,

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

To get started, you could have  as definition file :

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

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


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

hope this helps,
Stephane




Bitte antworten an users@cocoon.apache.org

An:   <users@cocoon.apache.org>
Kopie:

Thema:    Forms with "conditional" parts


Hi,

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
example:

(*) 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?

Bart.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org








---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message