<%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Basic - Button</title> </head> <body> <div style="padding:15px"> <h3>Click on Button Bellow</h3> <WAF:Button id="btnSayHi" text="Say Hi" /> <br/> <br/> <WAF:Label id="lblMessage" text="" /> </div> </body> </html>
package controllers; import com.openwaf.client.event.dom.ClickEvent; import com.openwaf.client.event.dom.ClickHandler; import com.openwaf.client.ui.annotation.ViewElement; import com.openwaf.client.ui.basic.Button; import com.openwaf.client.ui.basic.Label; import com.openwaf.core.framework.WAFController; public class ExBasicButton extends WAFController{ @ViewElement private Button btnSayHi; @ViewElement private Label lblMessage; private ExBasicButton(){ btnSayHi.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { lblMessage.setText("Thanks for the click"); } }); } }