On Fri, 28 Oct 2005 01:22:39 -0700, Dipu <[EMAIL PROTECTED]> wrote:

I think you should have your own implementation of the choice renderer for this, and should override the getDisplayValue method.
something like
public String getDisplayValue(Object object)
{
     USState state = (USState )object
     return state.getCode();
 }

and add tthe drop down as
 new DropDownChoice("id", Lsit of State Objects, new YourRenderer());

hope this helps

Cheers
Dipu



Thanks.

I tried implementing my own ChoiceRenderer, but the problem was the cast. Sometimes I would get passed in a String instead of a USState. I think this may be related what Johan mentioned in the other thread, about the selected object not being the same type as the List object. The problem is, I don't want to select the object and place it in my model, I just want a String. I built the USState objects because that is how the framework seems to want you to do it if you want to have full control over the option display and value.

I hope that makes sense.

David


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to