I want to use the ACTF in our projects, but it is not very helpful for
selecting objects. Typically the text you display for
selecting a person is not very unique or identifying for the object
that is associated: "Johnson, Frank" is perfect for display,
but is hard to dissect when you have to re-assemble the person on the
server side: the ACTF uses a String as the model.

I was thinking of a panel with the autocomplete text field which shows
the display value, and a hidden field that will hold the ID
of the selected object. The hidden field can then be used to fetch the
object on the server and assign it to the model object of
ObjectAutoCompleteTextField.

<wicket:panel>
<input type="text" wicket:id="displayvalue" />
<input type="hidden" wicket:id="idvalue" />
</wicket:panel>

The OACTF would need to communicate both the selection markup, and the
associated ID values that need to be set on the hidden
field upon selection. Now I could add a special tag to the selection
markup, something like below:

<ul>
        <li choiceid="12341">Johnson, Frank</li>
        <li choiceid="41231">Miller, Frank</li>
</ul>

But I imagine other possibilities are available (or using the markup
id itself).  Can you share your thoughts?

Martijn


--
Learn Wicket at ApacheCon Europe: http://apachecon.com
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.5 will keep your server alive. Download Wicket now!
http://wicketframework.org

Reply via email to