wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lon Varscsak <lon.varsc...@gmail.com>
Subject DropDownChoice and Object/Property
Date Thu, 05 May 2016 00:28:49 GMT
Hey all,

Is there a way to have a DropDownChoice use a complex object (think ORM
class) as it’s list, but get/set the Model’s value as the ID instead of the
complex object?

So for:

new DropDownChoice<>(“shipMethod”, new PropertyModel<>(OrderPage.this
.getOrderController().order().shippingHeader(), “shipMethod"), new
ListModel<>(shipMethods), new ChoiceRenderer<>("description", "id"))

It puts in the ORM object’s toString into the “shipMethod” column and I
want it to put in the value for “id” from the renderer.  Additionally, I
want it to get it’s initial value from the “id” value instead and convert
it to the ORM object (from shipMethods list).

Hopefully this makes sense. :P

-Lon (Wicket Newb, WebObjects Refugee)

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message