diff -r d7ec46950980 -r 08cd5a0c967e mojo/src/main/resources/archetype-resources/src/main/java/App.java --- a/mojo/src/main/resources/archetype-resources/src/main/java/App.java Sun Jan 13 06:59:05 2013 +0100 +++ b/mojo/src/main/resources/archetype-resources/src/main/java/App.java Tue Jan 22 09:19:47 2013 +0100 @@ -3,15 +3,29 @@ import org.apidesign.bck2brwsr.htmlpage.api.*; import static org.apidesign.bck2brwsr.htmlpage.api.OnEvent.*; import org.apidesign.bck2brwsr.htmlpage.api.Page; +import org.apidesign.bck2brwsr.htmlpage.api.Property; +import org.apidesign.bck2brwsr.htmlpage.api.ComputedProperty; /** Edit the index.xhtml file. Use 'id' to name certain HTML elements. * Use this class to define behavior of the elements. */ -@Page(xhtml="index.xhtml", className="Index") +@Page(xhtml="index.xhtml", className="Index", properties={ + @Property(name="name", type=String.class) +}) public class App { + static { + Index model = new Index(); + model.setName("World"); + model.applyBindings(); + } + @On(event = CLICK, id="hello") - static void hello() { - Index.HELLO.setDisabled(true); - Element.alert("Hello World!"); + static void hello(Index m) { + Element.alert(m.getHelloMessage()); + } + + @ComputedProperty + static String helloMessage(String name) { + return "Hello " + name + "!"; } }