Hi Alex,

No quite. Currently, you can return a Block to refresh a zone or a JSON array to send data to a custom handler on the client. My project has a number of dashboards and I use JSON data to refresh image tags to make 'real-time' charts and icons that automatically update. My handler replaces the <img> src tags when it receives the response.

I'd like to use the same framework to replace div bodies - essentially zones. In trying to get this to work I looked at the implementation of MultiZoneUpdate and I think that code could easily be reused to allow rendered blocks to be included in JSON responses. That would open up Tapestry 5 to developers creating applications like my dashboard that don't lend themselves to Zones. If you know a route to render a Block as part of a JSON XHR response I'd really appreciate a pointer. Otherwise I'm trying to understand if I should file a Jira suggesting this as an enhancement.

Thanks.

Chuck

Alex Kotchnev wrote:
Chuck,
  it is my understanding that today, when you return a Block in response to
an ajax request, the contents of that block do get serialized into a JSON
structure which is then parsed on the client. Isn't that what you need ?

Regards,

Alex Kotchnev

On Mon, May 10, 2010 at 2:18 AM, Chuck Kring <cjkr...@pacbell.net> wrote:

Hi guys,

My application uses Ajax extensively  to provide a dashboard-like
functionality.  I use a rather small Javascript library that contains a
poller and then updates img src= fields for every registered components.
This works very well for dashboard pages that have charts and status icons.

I'd love to be able to put zones in the page and call the ZoneUpdater from
my Javascript loop.   This seems easy because it's essentially the behavior
of the MultiZoneUpdate.

My question is shouldn't there be a coercer that allows a rendered block or
component to be added to a JSON return?
Chuck Kring

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



Reply via email to