@Retention(value=RUNTIME) @Target(value=METHOD) public @interface Expose
Controller class.
Methods annotated with this annotation can be refereed on .crux.xml and .view.xml pages.
A method must obey the following constraints to be exposed as an event handler:
1) Be annotated with @Expose annotation.
2) Have public visibility.
3) Have no parameter or have only one parameter, with type equals to the type of the event handled by the method.
For example:
@Controller("myController") public class MyController {@Expose public void myEventHandler() { Window.alert("event dispatched!"); } //Only can handle click events@Expose public void myClickEventHandler(ClickEventevent) { Window.alert("event dispatched!"); } }
It can be used on a .crux.xml or .view.xml page, as illustrated by the following example:
<htmlxmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://www.cruxframework.org/crux" xmlns:g="http://www.cruxframework.org/crux/gwt"><body><c:screenuseController="myController"/><g:buttonid="myButton" onClick="myController.myClickEventHandler" onDoubleClick="myController.myEventHandler" text="My Button"></g:button></body></html>
ControllerCopyright © 2015. All rights reserved.