You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by David Tio <ti...@gmail.com> on 2015/04/26 17:00:15 UTC
jQuery/autocomplete
Hi All,
I need help with tapestry jQuery/autocomplete. I want to fill up another
field based on the selection on jQuery/autocomplete textfield. What's the
best way to perform such action?
The only event available seems to be provideCompletions
Regards,
David Tio
Re: jQuery/autocomplete
Posted by Geoff Callender <ge...@gmail.com>.
Good points, Lance. Yes I will consider adding those features to JumpStart, and at the very least I will add a link to Observe. Thanks.
On 27 Apr 2015, at 7:37 pm, Lance Java <la...@googlemail.com> wrote:
> Hi Geoff, as stated on the demo, the observe mixin was inspired by zone
> updater but with a few very handy differences:
>
> 1. Developers don't need to deal with request parameters. These are
> converted to more user friendly event arguments.
>
> 2. You can pass multiple clientside field values. In the jump-start example
> you could get rid of the @persist usage with this feature.
>
> 3. Optional context, you can use the same serverside event for multiple
> observe instances or pass the loop index etc.
>
> I realise that jumpstart has far greater kudos than stitch. Would you
> consider adding these features to jumpstart?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: jQuery/autocomplete
Posted by Lance Java <la...@googlemail.com>.
Hi Geoff, as stated on the demo, the observe mixin was inspired by zone
updater but with a few very handy differences:
1. Developers don't need to deal with request parameters. These are
converted to more user friendly event arguments.
2. You can pass multiple clientside field values. In the jump-start example
you could get rid of the @persist usage with this feature.
3. Optional context, you can use the same serverside event for multiple
observe instances or pass the loop index etc.
I realise that jumpstart has far greater kudos than stitch. Would you
consider adding these features to jumpstart?
Re: jQuery/autocomplete
Posted by Geoff Callender <ge...@gmail.com>.
I realise this question doesn't relate to T5.4 but, for anyone who's searching the mailing list, here's a way to handle the same thing in T5.4.
<t:textfield t:id="personName" placeholder="message:search-placeholder"
t:mixins="autocomplete,zoneupdater" zoneUpdater.clientEvent="typeahead:selected typeahead:autocompleted blur"
zoneUpdater.event="changeOfPersonName" zoneUpdater.zone="prop:personReviewZoneId"/>
void onChangeOfPersonName(@RequestParameter(value = "input", allowBlank = true) String personName) {
// find the person and return an Ajax response that updates a zone.
...
}
ZoneUpdater: http://jumpstart.doublenegative.com.au/jumpstart7/examples/ajax/onevent
Geoff
On 27 Apr 2015, at 6:12 pm, Lance Java <la...@googlemail.com> wrote:
> Is your autocomplete a select component? If so you can set the 'zone'
> attribute and handle the 'onChanged' event to update the zone.
>
> There's also the observe mixin from tapestry-stitch (
> http://t5stitch-lazan.rhcloud.com/observedemo). Note: This will require a
> javascript tweak to work with jquery (currently prototype specific).
Re: jQuery/autocomplete
Posted by Lance Java <la...@googlemail.com>.
Is your autocomplete a select component? If so you can set the 'zone'
attribute and handle the 'onChanged' event to update the zone.
There's also the observe mixin from tapestry-stitch (
http://t5stitch-lazan.rhcloud.com/observedemo). Note: This will require a
javascript tweak to work with jquery (currently prototype specific).