cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject Re: Simlpe forms question (I hope)
Date Tue, 24 Jan 2006 15:42:57 GMT
On Tue, 2006-01-24 at 11:32 +0000, Duncan McLean wrote:
> Hi
> 
> How can I set a default value for a radio button?
> In this example we have 2 options (Single, Joint), and want Single to be
> default.
> 
> I know we can set the value in flow, but this would mean that the value
> would always be set to that value wouldn't it? What I mean is that if we
> take the example above, and the user clicked "Joint" and submitted the
> form, then subsequently returned to that form, the flow code would
> kick in and reset the value back to "Single" losing the users choice - or
> am I incorrect in that assumption?
> 
> Here's the relevant fragment of the form def:
> 
>     <fd:field id="kwdSingleJoint">
> 		<fd:label>Is this policy a Single Life or Joint Life policy?</fd:label>
> 		<fd:datatype base="string"/>
> 		<fd:selection-list>
> 			<fd:item value="Single"/>
> 			<fd:item value="Joint"/>
> 		</fd:selection-list>
> 	</fd:field>
> 
> I was hoping that "<fd:initial-value>Single</fd:initial-value>" would
> work, but no luck.
> 
> Any suggestions on how this can be achieved?

fd:initial-value should work, at least if you are using Cocoon 2.1.8 (I
don't know exactly in which version this feature was introduced).

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


Mime
View raw message