Take a look at autocomplete's javadoc:
* An {@link IAutoCompleteRenderer} is used for rendering of choices.
To convert input back into a
* non-String type you will have to provide a custom {@link
IConverter}, either by overriding
* {@link #getConverter(Class)} or by setting a suitable {@link
IConverter} on the application's
* {@link ConverterLocator}.
Sven
On 05/14/2013 11:26 PM, saty wrote:
I have used this before as a simple String model which works fine but with
other types i have some isues going on any help would be appreciated.
using:
final AutoCompleteTextField<XYZ> something = new
AutoCompleteTextField<XYZ>("code", xYZTypeModel, renderer)
the options are displayed correctly selects fine too but
XYZ.getObject() call throws exception:
java.lang.ClassCastException: java.lang.String cannot be cast to XYZ
not sure how it is able to Set String in a XYZ type.
I am using below renderer
IAutoCompleteRenderer<XYZ> renderer = new
AbstractAutoCompleteTextRenderer<XYZ>()
{
private static final long serialVersionUID = 1L;
@Override
protected String getTextValue(XYZ object)
{
return XYX.getDisplayText();
}
};
Thanks
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/AutoCompleteTextField-issues-tp4658798.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org