You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by drf <da...@gmail.com> on 2011/06/14 16:42:16 UTC

AutoCompleteTextField which uses an Object, not a String

I have a model which backs a form.
One of the fields in the model is a custom object type, City.
In the form I have a field defined as AutoCompleteTextField<City>.
This is populated with a list of City objects, and because City.toString()
is overriden, everything displays nicely in the list.
However, when a city is chosen, the model does not appear to be getting
updated. I cannot find another way to access the City object which was
selected.
Can anyone help?


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/AutoCompleteTextField-which-uses-an-Object-not-a-String-tp3596762p3596762.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: AutoCompleteTextField which uses an Object, not a String

Posted by Clint Checketts <ch...@gmail.com>.
Yesterday while playing with AutoCompleTextField, I created a quickstart to
show how it is 'broken'. I hadn't thought of using a converter. After using
a converter the component behaves as I'd expect.

So a simpler solution could be: 1) improve the AutoCompleteTextField's java
doc to explain using the converter 2) update the wicketExample page to
include an example using a converter, 3) add some logic, or an ease of use
hook so that AutoComplete can detect when its being used against objects
that aren't strings and is breaking.

I'll open a Jira, attach the quickstart and attach a patch that takes care
of those 3 pieces. Yesterday I glanced at the ObjectAutoComplete and it
looks very powerful, but maybe even more complex.

My initial desire was that an AutoCompleteTextField mirror how a
DropDownChoice behaves by default. I'll try to demonstrate that in my patch.

-Clint



On Tue, Jun 14, 2011 at 10:51 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> we dont need to deprecate the existing one. it does something that
> object-autocomplete does not - lets you enter free-form-text with some
> assistance.
>
> -igor
>
> On Tue, Jun 14, 2011 at 6:55 PM, Jeremy Thomerson
> <je...@wickettraining.com> wrote:
> > I'd be up for at least moving the ObjectAutoComplete into core and adding
> > @Deprecated to the existing one before 1.5.0 if there is consensus on it.
> >
> > --
> > Jeremy Thomerson
> > http://wickettraining.com
> > *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
> >
> > On Tue, Jun 14, 2011 at 11:27 AM, James Carman
> > <ja...@carmanconsulting.com>wrote:
> >
> >> On Tue, Jun 14, 2011 at 11:25 AM, Clint Checketts <ch...@gmail.com>
> >> wrote:
> >> > Is there a good reason (besides backwards compatiblity) that the
> >> > objectautocomplete hasn't replaced the broken string based one in
> >> > wicket-extensions?
> >> >
> >> > It seems like AutoComplete should behave as similarly to
> DropDownChoice
> >> as
> >> > possible. As it currently is, IChoiceRenderer feels broken with it.
> >> >
> >>
> >> I would think it should have at least made its way into the "core" or
> >> "extension" by now.  There have been enough requests for it.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: AutoCompleteTextField which uses an Object, not a String

Posted by Igor Vaynberg <ig...@gmail.com>.
we dont need to deprecate the existing one. it does something that
object-autocomplete does not - lets you enter free-form-text with some
assistance.

-igor

On Tue, Jun 14, 2011 at 6:55 PM, Jeremy Thomerson
<je...@wickettraining.com> wrote:
> I'd be up for at least moving the ObjectAutoComplete into core and adding
> @Deprecated to the existing one before 1.5.0 if there is consensus on it.
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>
> On Tue, Jun 14, 2011 at 11:27 AM, James Carman
> <ja...@carmanconsulting.com>wrote:
>
>> On Tue, Jun 14, 2011 at 11:25 AM, Clint Checketts <ch...@gmail.com>
>> wrote:
>> > Is there a good reason (besides backwards compatiblity) that the
>> > objectautocomplete hasn't replaced the broken string based one in
>> > wicket-extensions?
>> >
>> > It seems like AutoComplete should behave as similarly to DropDownChoice
>> as
>> > possible. As it currently is, IChoiceRenderer feels broken with it.
>> >
>>
>> I would think it should have at least made its way into the "core" or
>> "extension" by now.  There have been enough requests for it.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: AutoCompleteTextField which uses an Object, not a String

Posted by Jeremy Thomerson <je...@wickettraining.com>.
I'd be up for at least moving the ObjectAutoComplete into core and adding
@Deprecated to the existing one before 1.5.0 if there is consensus on it.

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*

On Tue, Jun 14, 2011 at 11:27 AM, James Carman
<ja...@carmanconsulting.com>wrote:

> On Tue, Jun 14, 2011 at 11:25 AM, Clint Checketts <ch...@gmail.com>
> wrote:
> > Is there a good reason (besides backwards compatiblity) that the
> > objectautocomplete hasn't replaced the broken string based one in
> > wicket-extensions?
> >
> > It seems like AutoComplete should behave as similarly to DropDownChoice
> as
> > possible. As it currently is, IChoiceRenderer feels broken with it.
> >
>
> I would think it should have at least made its way into the "core" or
> "extension" by now.  There have been enough requests for it.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: AutoCompleteTextField which uses an Object, not a String

Posted by James Carman <ja...@carmanconsulting.com>.
On Tue, Jun 14, 2011 at 11:25 AM, Clint Checketts <ch...@gmail.com> wrote:
> Is there a good reason (besides backwards compatiblity) that the
> objectautocomplete hasn't replaced the broken string based one in
> wicket-extensions?
>
> It seems like AutoComplete should behave as similarly to DropDownChoice as
> possible. As it currently is, IChoiceRenderer feels broken with it.
>

I would think it should have at least made its way into the "core" or
"extension" by now.  There have been enough requests for it.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: AutoCompleteTextField which uses an Object, not a String

Posted by Clint Checketts <ch...@gmail.com>.
Is there a good reason (besides backwards compatiblity) that the
objectautocomplete hasn't replaced the broken string based one in
wicket-extensions?

It seems like AutoComplete should behave as similarly to DropDownChoice as
possible. As it currently is, IChoiceRenderer feels broken with it.

-Clint

On Tue, Jun 14, 2011 at 9:49 AM, Martin Grigorov <mg...@apache.org>wrote:

> maybe you need
> https://github.com/wicketstuff/core/tree/master/jdk-1.5-parent/objectautocomplete-parent
>
> On Tue, Jun 14, 2011 at 5:42 PM, drf <da...@gmail.com> wrote:
> > I have a model which backs a form.
> > One of the fields in the model is a custom object type, City.
> > In the form I have a field defined as AutoCompleteTextField<City>.
> > This is populated with a list of City objects, and because
> City.toString()
> > is overriden, everything displays nicely in the list.
> > However, when a city is chosen, the model does not appear to be getting
> > updated. I cannot find another way to access the City object which was
> > selected.
> > Can anyone help?
> >
> >
> > --
> > View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/AutoCompleteTextField-which-uses-an-Object-not-a-String-tp3596762p3596762.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: AutoCompleteTextField which uses an Object, not a String

Posted by Martin Grigorov <mg...@apache.org>.
maybe you need https://github.com/wicketstuff/core/tree/master/jdk-1.5-parent/objectautocomplete-parent

On Tue, Jun 14, 2011 at 5:42 PM, drf <da...@gmail.com> wrote:
> I have a model which backs a form.
> One of the fields in the model is a custom object type, City.
> In the form I have a field defined as AutoCompleteTextField<City>.
> This is populated with a list of City objects, and because City.toString()
> is overriden, everything displays nicely in the list.
> However, when a city is chosen, the model does not appear to be getting
> updated. I cannot find another way to access the City object which was
> selected.
> Can anyone help?
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/AutoCompleteTextField-which-uses-an-Object-not-a-String-tp3596762p3596762.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org