sorry, i guess i could have explained that better. my option prividing and selection works just fine, but my use for the autocomplete is such that when an option is selected i would like to trigger an asynchronous server request/response.

previously (in tapestry4.1) i've done this by submitting the containing form asynchronously by providing a listener with the following annotation:

@EventListener(targets = "myComponent", events = "onValueChanged")
public void myListener()...

at this point i would update some components on the page and run some more javascript.

i imagine there's something similar in tapestry5 but it's not obvious to me yet.

p.

Thiago H. de Paula Figueiredo wrote:
On Fri, 14 May 2010 00:43:02 -0300, Paul Stanton <p...@mapshed.com.au> wrote:

just further to that, i'm new to tapestry5 and haven't completed my reading on ajax etc,

but how would i listen for the 'something selected from list' event (for the autocomplete mixin), and do some asynchronous server side processing?

From the Autocomplete page: http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/mixins/Autocomplete.html

Just create a method

List<String> onProvideCompletionsFrom[component id](String string) {
    // return a list of string containing the suggestions.
}

I'm not sure I understood what you meant, but Tapestry handles all the AJAX plumbing for you automatically. Just handle the event triggered by the component, mixin or page. Writing a method to handle an AJAX request triggered by a Tapestry component, mixin or page event is done exactly in the same way non-AJAX events are handled.

Each component and mixin defines which events they triggers and how they process the value returned by the event handler method.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to