On Mon, Dec 12, 2011 at 1:37 AM, Guillaume Bodet <gbo...@financeactive.com> wrote: > The event handler method throws an exception : > A component event handler method returned the value > org.apache.tapestry5.services.StreamPageContent@5f00498c. Return type > org.apache.tapestry5.services.StreamPageContent can not be handled. > > I believe this is related to the fact that the request is an XHR request, and > the ajax component event handler doesn't kno how to handle the > streampagecontent… any idea?
Because the browser is expecting a JSON response, and not a stream of HTML? >From an XHR request, you can return a page class or page instance and it will, I believe, encode a JSON response to redirect to the page. > > Regards > > Guillaume > > > Le 10 déc. 2011 à 06:09, Howard Lewis Ship a écrit : > >> See >> http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/StreamPageContent.html >> >> On Wed, Dec 7, 2011 at 2:17 AM, Guillaume Bodet >> <gbo...@financeactive.com> wrote: >>> Hi, >>> >>> I'm using a nice js component called DHTMLX Grid in my T5 application. >>> DhtmlxGrid fetched its data in an ajax request. Data is formatted as XML : >>> <rows> >>> <head> >>> <column>…</column> >>> </head> >>> <row> >>> <cell>…</cell> >>> </row> >>> </rows> >>> >>> It is very convenient to use a tapestry page to dynamically create this >>> file. >>> >>> Right now, I'm providing the grid a page render link to the xml page to >>> fetch its data. It works great but requires extra effort to share state >>> between the containing page and the data page. >>> >>> What I would like to do is providing the data through an event link in the >>> main page. >>> >>> Here is what the code could look like : >>> >>> @InjectPage >>> private XMLDataPage dataPage; >>> >>> @OnEvent("loadGrid") >>> StreamResponse provideGridData(){ >>> dataPage.setState(state); >>> String result = pageRenderer.renderPageToString(dataPage); >>> return new XMLStreamResponse(result); >>> } >>> >>> Is it feasible ? >>> >>> Regards >>> >>> Guillaume >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>> For additional commands, e-mail: users-h...@tapestry.apache.org >>> >> >> >> >> -- >> Howard M. Lewis Ship >> >> Creator of Apache Tapestry >> >> The source for Tapestry training, mentoring and support. Contact me to >> learn how I can get you up and productive in Tapestry fast! >> >> (971) 678-5210 >> http://howardlewisship.com >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org