Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added mention of more event handler return values

...

For page navigation events (originating in components such as EventLink, ActionLink and Form), the value returned from an event handler method determines how Tapestry will render a response.If the event handler method returns

  • Null: For no value, or

...

  • null,

...

  • the current page (the page containing the component) will render the response.

...

  • Page: For the name of a page, or a page class or page instance

...

  • ,

...

  • a render request URL will be constructed and sent to the client as a redirect to that page.

...

  • URL: For a java.net.URL

...

  • , a redirect will be sent to the client. (In Tapestry 5.3.x and earlier, this only works for non-Ajax requests.)
  • Zone body: In the case of an Ajax request to update a zone, the component event handler will return the new zone body, typically via an injected component or block.
  • HttpError: For an HttpError, an error response is sent to the client.
  • Link: For a Link, a redirect is sent to the client.
  • Stream: For a StreamResponse, a stream of data is sent to the client

See Page Navigation for other return valuesmore details.

Multiple Method Matches

In some cases, there may be multiple event handler methods matching a single event. In that case, Tapestry invokes them in the following order:

...