Hello,

The template file does preserve any tags inside wt:widget, but it's not
possible for instance to define the id attribute of an item:value as the
item:values are only defined in the form definition file. 
What should I modify if I want to use my own id attribute inside an html
input field instead of using the generated ID as it is done in
woody-field-styling.xsl.  
Instead of : 
   <input id="{generate-id()}" type="checkbox" value="[EMAIL PROTECTED]"
name="{$id}">

I would like to use:
        <input id="[EMAIL PROTECTED]" type="checkbox" value="[EMAIL PROTECTED]" 
name="{$id}">

but therefore I need to assign an id attribute in my definition such as:

        <wd:item value="option1" id="001"/>

But this id attribute is not preserved by the Woody transformer and hence my
problem...

I think in general it would be useful if the Woody transformer copies all
attributes of the <wd:*> tags to the <wi:*> tags.
I have been looking in the source but could not really find the place where
I  could modify this.
Any help is welcome !
wouter


-----Original Message-----
From: Bruno Dumon [mailto:[EMAIL PROTECTED]
Sent: vendredi 21 novembre 2003 16:53
To: [EMAIL PROTECTED]
Subject: Re: Woody: dependent widget


On Thu, 2003-11-20 at 14:21, [EMAIL PROTECTED] 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
[EMAIL PROTECTED]                          [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to