You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Wo...@cec.eu.int on 2003/11/20 14:21:53 UTC
Woody: dependent widget
Hello,
I would like to integrate into Woody the possibility that the visibility of
a widget depends on the value of another. An example: when i click for
instance a check box , a "unvisible widget" is made visible (with
Javascript) In general, certain questions in my form must only appear when
a user has chosen a certain value in a question above.
Therefore I would like to add some attributes in my widget definition to
indicate that a certain "item value" points to another widget. I need these
additional attributes in order to generate the Javascript afterwards. For
instance in the following example, if the user choses item value "option1"
then and only then question 2 should appear:
<wd:multivaluefield id="question1">
<wd:label>question 2 text</wd:label>
<wd:datatype base="string"/>
<wd:selection-list>
<wd:item value="option1" id="001" point="question2"/>
<wd:item value="option2"/>
<wd:item value="option3"/>
</wd:selection-list>
</wd:multivaluefield>
<wd:field id="question2" ispointed="001">
<wd:label>question 2 text:</wd:label>
<wd:datatype base="long"/>
</wd:field>
When I add these attributes however in my form definition file they are not
preserved by the woody transformer when he produces his form instance. What
should I modify (Java classes , stylesheets, ..) in order to have my
additional attributes preserved?
If anyone has implemented the same type of functionality perhaps with a
different approach I will be glad to hear from you.
thanks,
wouter
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Woody: dependent widget
Posted by Bruno Dumon <br...@outerthought.org>.
On Thu, 2003-11-20 at 14:21, Wouter.DERUYCK@cec.eu.int wrote:
> Hello,
>
> I would like to integrate into Woody the possibility that the visibility of
> a widget depends on the value of another. An example: when i click for
> instance a check box , a "unvisible widget" is made visible (with
> Javascript) In general, certain questions in my form must only appear when
> a user has chosen a certain value in a question above.
> Therefore I would like to add some attributes in my widget definition to
> indicate that a certain "item value" points to another widget. I need these
> additional attributes in order to generate the Javascript afterwards. For
> instance in the following example, if the user choses item value "option1"
> then and only then question 2 should appear:
>
> <wd:multivaluefield id="question1">
> <wd:label>question 2 text</wd:label>
> <wd:datatype base="string"/>
> <wd:selection-list>
> <wd:item value="option1" id="001" point="question2"/>
> <wd:item value="option2"/>
> <wd:item value="option3"/>
> </wd:selection-list>
> </wd:multivaluefield>
>
> <wd:field id="question2" ispointed="001">
> <wd:label>question 2 text:</wd:label>
> <wd:datatype base="long"/>
> </wd:field>
>
>
> When I add these attributes however in my form definition file they are not
> preserved by the woody transformer when he produces his form instance. What
> should I modify (Java classes , stylesheets, ..) in order to have my
> additional attributes preserved?
> If anyone has implemented the same type of functionality perhaps with a
> different approach I will be glad to hear from you.
I think your problem is a completely client-side related one, so is more
related to the template than the definition. In the template, you can
add any tags inside the wt:widget element and they will be preserved, so
that you can use them in the XSLT.
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org bruno@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org