Here it is a quickstart app with MultiAutoCompleteTextField component prototype:
http://interwicket.googlecode.com/files/multiautocomplete.zip

It is a draft solution, I have no time to polish it yet, so it is not
a super elegant ;). MultiAutoCompleteTextField works very similar like
a standard AutoCompleteTextField but there is a one new method:

protected Collection<Component> getRelatedComponents();

By default this method returns null and then this component works like
a AutoCompleteTextField (autocomplete only one field). If you want to
complete other components, you should return collection of those
components in this method (in the final solution specifying these
components should be a bit more comfortable). The next change is that
you should use AbstractMultiAutoCompleteRenderer, which has a new
method:

protected abstract Map<String, String> getRelatedTextValues(Object object);

where you should return a map of entries containing
<componentMarkupId, textValueForThisComponent>.

Maybe more elegant would be to define a
AbstractComponentMultiAutoCompleteRenderer with method:
protected abstract String getRelatedComponentTextValue(Object object,
Component component);

The main change is done in AbstractMultiAutoCompleteBehavior and
multi-autocomplete.js. The JS class Wicket.MultiAutoComplete now
accepts one more argument: a table of related components' markup ids.
Text values for these components are passed from renderer as arguments
of <li> tag in the following format: textvalue_markupId.

The rest you can see in the sources ;).

--
Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to