ciao,
I think Autocompletetextfield deals only with String.
IIRC there is a objectautocomplete in wicketstuff.
I did not use it personally but I suppose that does what you need.
Giovanni
Il 01/08/12 12.31, Daniele Dellafiore ha scritto:
Hi.
I'm sure I'm talking about something that has already been discussed
here and on stackoverflow a lot, but still I haven't found a solution.
I do not understand how AutocompleteTextField works when dealing with
list of objects that are not just strings. Other wicket components
like DropDown has a clear pattern: the renderer is used only for
rendering purpose, there's a model to store selection and a model to
store choices options.
Still, I can't figure out how to do the very same thing with
AutocompleteTextField.
The best I can get is:
TextField codeField = new
AutoCompleteTextField<JSONObject>("code",
model, JSONObject.class, renderer,
new AutoCompleteSettings());
I'm using an AbstractAutoCompleteTextRenderer and a PropertyModel
binded to a JSONObject variable.
It all works but when I submit the form, it says me that the selected
string is not a valid JSONObject, so he cannot attach it to the field.
the ITerator returned by AutocompleteTextField.getChoices(String
input) is an Iterator of JSONObject.
I expect that when I submit, the setObject receives the selected
JSONObject, not the String I do render using a specific Renderer.
How can that be done?
Thanks anyone for help.
--
Giovanni Cuccu
Responsabile area sviluppo - CUP 2000 Spa
Via del Borgo di S. Pietro, 90/c - 40126 Bologna
e-mail: giovanni.cuccu _at_ cup2000.it
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]