Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Small corrections

...

An event handler often needs to update multiple zones on the client side. To accomplish this, use an AjaxResponseRenderer (or, for Tapestry 5.2 and earlier, return a MultiZoneUpdate object), indicating the zones to update. You must know the client-side id for each zone to update (the best way for this is to lock down the zone's id using the id parameter of the Zone component).

AjaxResponseRenderer was introduced in Tapestry 5.3. For Tapestry 5.2 and earlier, return a MultiZoneUpdate object instead).

The renderer for each zone can be the zone's body, a block or , a component, or a Renderable or a RenderCommand ... or an object, such as String, that can be coerced to either of these. Typically, you will inject a Block or Component and return that:

Section
Column
Code Block
java
java
titleFor Tapestry 5.3 and later
@InjectComponent
private Zone userInput;

@InjectComponent
private Zone helpPanel;

@Inject
private AjaxResponseRenderer ajaxResponseRenderer;

void onActionFromRegister()
{
    ajaxResponseRenderer.addRender("userInput", userInput)
                .addRender("helpPanel", helpPanel);
}
Column
Code Block
java
java
titleFor Tapestry 5.1, 5.2 and 5.3
@Inject
private Form registrationForm;

@Inject Block registrationHelp;

Object onActionFromRegister()
{
    return new MultiZoneUpdate("userInput", registrationForm)
                .add("helpPanel", registrationHelp);
}

    Note that MultiZoneUpdate is deprecated starting with Tapestry 5.3.

...