3 import org.apidesign.bck2brwsr.htmlpage.api.*;
4 import static org.apidesign.bck2brwsr.htmlpage.api.OnEvent.*;
5 import org.apidesign.bck2brwsr.htmlpage.api.Page;
6 import org.apidesign.bck2brwsr.htmlpage.api.Property;
7 import org.apidesign.bck2brwsr.htmlpage.api.ComputedProperty;
9 /** Edit the index.xhtml file. Use 'id' to name certain HTML elements.
10 * Use this class to define behavior of the elements.
12 @Page(xhtml="index.xhtml", className="Index", properties={
13 @Property(name="name", type=String.class)
17 Index model = new Index();
18 model.setName("World");
19 model.applyBindings();
22 @On(event = CLICK, id="hello")
23 static void hello(Index m) {
24 Element.alert(m.getHelloMessage());
28 static String helloMessage(String name) {
29 return "Hello " + name + "!";