It seems that Button is not designed for ajax. I wonder why you don't try block/zone?
DH http://www.gaonline.com.cn/ ----- Original Message ----- From: "b...@umd" To: <users@tapestry.apache.org> Sent: Friday, June 26, 2009 2:48 AM Subject: Re: Tapestry 5 and Event component. > > Ok, it seems to come from the parameter "String value" in my onButtonClicked > statement. I removed it and the event is now handled. However it appears > that I am not allowed to return a JSONObject from the OnButtonClicked > method. May be is it not possible with this kind of component. > > But perhaps you can still help me. I am trying to make a research function > for my interface. For the moment, it works great with the following code : > > gentoo.tml : > <t:textfield t:id="textfield" t:value="textFieldValue" t:mixins="OnEvent" > event="blur" onCompleteCallback="onSearchRequest" /> > > > gentoo.java : > @OnEvent(component = "textfield", value = "blur") > public JSONObject onBlurEvent(String value) { > System.out.println("Event Caught !"); > String translatedValue = "Package not found !"; > try { > String category=applicationManager.getCategoryFromApplication(value); > if (category != null) { > translatedValue = "This package is located in category > <strong>"+category+"</strong>."; > } > return new JSONObject().put("translatedValue", > translatedValue);} > catch(Exception e){} > return new JSONObject().put("translatedValue", translatedValue); > } > > gentoo.js : > /* This is to update the Textfield component 'result' */ > function onSearchRequest(response) { > $('result').update("Search result(s) : "+response.translatedValue); > } > > My problem is that the search is performed on "blur" event (when the user > click anywhere outside the textfield box) whereas I would like to perform it > when the user click on a button instead. So that is why I believed I could > trigger this event by changing the "blur" event into a "clicked" event. > > Does anyone know how I can simply do that ? > > > > > > -- > View this message in context: > http://www.nabble.com/Tapestry-5-and-Event-component.-tp24192270p24209012.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >