So, you want the codes to be the values? Why not use a map-based renderer as opposed to creating a whole new class?
On Mon, May 4, 2009 at 9:48 PM, 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]
