I've found this is only a problem when you don't specify the zone's clientId in the tml:

<t:zone t:id="myZone" id="myZone">${theTime}</t:zone>

will work with

@InjectComponent private Zone myZone;
void onMyEvent() {
    ajaxResponseRenderer.addRender(myZone);
}

.. and this is well documented:

http://tapestry.apache.org/ajax-components-faq.html
"To do this, you must know, on the server, the client ids of each Zone. That's one of the reasons that you will generally set the Zone's client id (via the Zone's id parameter), rather than let Tapestry assign a client id for you."

So sorry for the tangent ;)

On 6/03/2012 7:49 PM, Paul Stanton wrote:
Oh, hang on...

I've just tried out what I ASSUMED was the 'recommended' way of performing zone updates via AjaxResponseRenderer:

@InjectComponent private Zone myZone;

void onMyEvent()
{
    ajaxResponseRenderer.addRender(myZone);
}

... and this doesn't work either! I get an error on the client: "Unable to locate Ajax Zone '' for dynamic update."

Its not until I specify the "componentId" (note not the clientId, because I cannot get access to that) that it again works...

void onMyEvent()
{
    ajaxResponseRenderer.addRender("myZone", myZone);
}

Is this a bug or expected behaviour?

Thanks, Paul.

 On 6/03/2012 7:16 AM, Thiago H. de Paula Figueiredo wrote:
On Mon, 05 Mar 2012 16:27:30 -0300, Paul Stanton <p...@mapshed.com.au> wrote:

Well it seems to be working (multiple times, so it's finding the zone/component to render) as is, however I'd prefer to implement something that should work rather than something that just happens to work!

If the component isn't inside a Loop or Grid, it won't be a problem, but

Is lance's suggestion regarding @HeartbeatDeferred a better idea? I can't figure out how to implement the use of heartbeat in the context of a service... I tried annotating the method directly, but that didn't seem to have any effect.

The annotation, as far as I know, will only work in pages, components and mixins.


---------------------------------------------------------------------
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

Reply via email to