Try adding a selectoption in you 'backingbean'. The Dropdown choice want to 'bind' it self to the same type of property in the model as in the List that you fill it with. If you use the generics on the dropdown it will be much clearer. Jens Alenius
Juha Palomäki wrote: > > I think the exception "org.apache.wicket.WicketRuntimeException: No > get method defined for class: class java.lang.String expression: id" > means that Wicket is looking for the getId() method from String, not > from your own SelectOption. > > Br, > Juha > > On Tue, May 5, 2009 at 4:48 AM, Phillip Rhodes <[email protected]> > wrote: >> It's of type String >> >> Thanks >> >> On May 4, 2009, at 3:23 PM, James Carman wrote: >> >>> The "handicapAccess" property is of type? >>> >>> On Mon, May 4, 2009 at 2:29 PM, Phillip Rhodes >>> <[email protected]> wrote: >>>> >>>> Hi everyone, >>>> Sorry for posting this problem but I have been stuck for far too many >>>> hours on this. Using wicket 1.4 Appreciate any help on this very very >>>> much. >>>> >>>> I have a pojo object called "address" that has a property of >>>> "handicapAccess" >>>> I am trying to bind this property to a dropdown list with 3 choices >>>> (formated as name/value) >>>> Yes/Y >>>> No/N >>>> Unknown/U >>>> >>>> If I use the constructor of ChoiceRenderer(String displayExpression), >>>> No >>>> error, but my property is bound as >>>> com.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd >>>> If I use the constructor of ChoiceRenderer(java.lang.String >>>> displayExpression, java.lang.String idExpression), I get an error >>>> "org.apache.wicket.WicketRuntimeException: No get method defined for >>>> class: >>>> class java.lang.String expression: id" >>>> Although my SelectOption class has getId/setId >>>> >>>> >>>> List<SelectOption> options = new ArrayList<SelectOption>(); >>>> options.add(new SelectOption("Yes", "Y")); >>>> options.add(new SelectOption("No", "N")); >>>> options.add(new SelectOption("Unknown", "U")); >>>> >>>> //org.apache.wicket.WicketRuntimeException: No get method defined for >>>> class: class java.lang.String expression: id >>>> ChoiceRenderer choiceRenderer = new ChoiceRenderer("name","id"); >>>> >>>> //this choice render gives it a >>>> // >>>> <handicapAccess>com.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd</handicapAccess> >>>> //ChoiceRenderer choiceRenderer = new ChoiceRenderer("name"); >>>> PropertyModel model = new PropertyModel(address, "handicapAccess"); >>>> >>>> DropDownChoice ddc = new DropDownChoice("dropDownChoice", >>>> model,options,choiceRenderer); >>>> >>>> >>>> //Here's my SelectOption >>>> public class SelectOption implements Serializable { >>>> /** >>>> * >>>> */ >>>> private static final long serialVersionUID = 1L; >>>> private String name; >>>> private String id; >>>> >>>> public SelectOption(String name, String id) { >>>> this.name = name; >>>> this.id = id; >>>> } >>>> >>>> public String getName() { >>>> return name; >>>> } >>>> >>>> public void setName(String name) { >>>> this.name = name; >>>> } >>>> >>>> public String getId() { >>>> return id; >>>> } >>>> >>>> public void setId(String id) { >>>> this.id = id; >>>> } >>>> >>>> } >>>> >>>> >>>> >>>> >>>> >>>> >>>> --------------------------------------------------------------------- >>>> 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] >>> >> >> >> --------------------------------------------------------------------- >> 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] > > > -- View this message in context: http://www.nabble.com/DropDownChoice-with-ChoiceRender-problem-tp23374394p23385127.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]
