Package org.apache.tapestry5.annotations
Annotation Type PublishEvent
-
@Target(METHOD) @Retention(RUNTIME) @Documented @UseWith({COMPONENT,PAGE}) public @interface PublishEvent
Marks an event handler method to be published as an event to be called in JavaScript through the
t5/core/ajax
function when theoptions
parameter has anelement
attribute.The logic for obtaining the URL is actually located implemented in the
t5/core/dom.getEventUrl(eventName, element)
function.The event information is stored in JSON format inside the "data-component-events" attribute.
When used in a component method, the component must render at least one element, and that's what gets the "data-component-events" attribute above. If it doesn't, an exception will be thrown.
When used in a page method, the page must render an <body> element. If it doesn't, an exception will be thrown.
- Since:
- 5.4.2
- See Also:
- Invoking server-side event handler methods from JavaScript