Scott,

To answer your last question, to set a selected value on the RadioChoice,
you must set the PropertyModel's value to what you want selected.  One thing
that took me a while to figure out personally (and I have been programming
in java for several years) is that the Object you set in the PropertyModel
must be of the same type (class) as the objects in your list of choices.  

This is what Per was referring to.  So if you have a list of Integers as
choices, set the propertymodel to an integer.  If you instead have a more
complex Object (say MyChoiceObject) for your choices you use that.  To
render the choices, Wicket by default will just do ToString on the Object
inthe choices list, unless you create an IChoiceRenderer.  In any event, you
need to set the PropertyModel's object to an object that is int he List of
choices to preselect one of the objects.  The example below is a good on,
you should look at the RadioChoice and DropDownChoice, since they both use
the same idea with their propertymodels.

The point is that at some time, Wicket will try to cast one of the objects
in the list into the variable in the propertymodel, so they have to  have
the same type.

Hope this helps...
-Clay


Newgro wrote:
> 
> 
> The example you should understand is here 
> http://www.wicketstuff.org/wicket13/forminput/
> There is a link in the upper right corner with source code. The classes 
> FormInput.java and FormInputModel.java should help you out.
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/RadioChoice-%3A-default-choice---tp14876844p15001375.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to