Re: AutoCompleteTextField issues
Thanks!! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AutoCompleteTextField-issues-java-lang-String-cannot-be-cast-to-tp4658798p4658912.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
Re: AutoCompleteTextField issues
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 AutoCompleteTextFieldXYZ something = new AutoCompleteTextFieldXYZ(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 IAutoCompleteRendererXYZ renderer = new AbstractAutoCompleteTextRendererXYZ() { 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
Re: AutoCompleteTextField issues
Hi, as far as I remember I solved that by using one of the avalaible ACTF constructors with ClassT type. new AutoCompleteTextFieldXYZ(code, xYZTypeModel, renderer, XYZ.class) Patrick Am 14.05.2013 23:26, schrieb saty: 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 AutoCompleteTextFieldXYZ something = new AutoCompleteTextFieldXYZ(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 IAutoCompleteRendererXYZ renderer = new AbstractAutoCompleteTextRendererXYZ() { 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 -- Mit freundlichen Grüßen, Patrick Davids NuboIT GmbH Co. KG Kieler Str. 103-107 • 25474 Bönningstedt Email: patrick.dav...@nuboit.de Handelsregister: HRA6819 Pi | Amtsgericht Pinneberg Geschäftsführung der Verwaltungsgesellschaft Daniel Fraga Zander HRB10145Pi | Amtsgericht Pinneberg - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AutoCompleteTextField issues
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 AutoCompleteTextFieldXYZ something = new AutoCompleteTextFieldXYZ(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 IAutoCompleteRendererXYZ renderer = new AbstractAutoCompleteTextRendererXYZ() { 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