You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Leon Derks <le...@cumquat.nl> on 2008/04/29 13:59:03 UTC
Autocomplete providecompletions + extra parameter
Hello
Is it possible to add an extra context parameter to the
providecompletions method?
For example like this:
List<String> onProvideCompletionsFromAccountName(Long categoryId, String partial) {
List<Product> matches = productDAO.findByPartialNameInCategory(partial, categoryId);
...
}
How can I do this without an @Persist on my categoryId?
Leon
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Autocomplete providecompletions + extra parameter
Posted by Josh Canfield <jo...@thedailytube.com>.
> Is it possible to add an extra context parameter to the providecompletions
> method?
You can change the content that is sent for the list by extending the
Autocomplete mixin and override the generateResponseMarkup method.
http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/corelib/mixins/Autocomplete.html#generateResponseMarkup(org.apache.tapestry.MarkupWriter,
java.util.List)
But getting at any attributes or nodes you've added to the <li> is
more difficult, assuming you wanted to update two fields with the same
autocomplete item (e.g. the id and the name).
Josh
On Tue, Apr 29, 2008 at 4:59 AM, Leon Derks <le...@cumquat.nl> wrote:
> Hello
>
> Is it possible to add an extra context parameter to the providecompletions
> method?
>
> For example like this:
>
> List<String> onProvideCompletionsFromAccountName(Long categoryId, String
> partial) {
> List<Product> matches =
> productDAO.findByPartialNameInCategory(partial, categoryId);
> ...
> }
>
> How can I do this without an @Persist on my categoryId?
>
> Leon
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org