3 Replies Latest reply on Feb 21, 2013 3:44 AM by Erik Jan de Wit

    EvenHandlers are not working

    s.kakrayne Newbie

      I am new to errai and trying to make simple app.

       

      HTML file is in location src/main/webapp/

      <head>

                <title>Errai Sample2</title>

      </head>

      <body>

                <div data-field="login-form">

                          <form >

      <legend>Log in to your account_2</legend>

                                    <label for="username">Username</label>

                                    <input data-field="username" id="username" type="text" placeholder="Username">

                                    <label for="username">Password</label>

                                    <input data-field="pass" id="password" type="password" placeholder="Password">

                                    <button data-field="submit">Log in</button>

                                    <button>Cancel</button>

      </form>

                </div>

                <hr>

       

      and Java code is in location src/main/java/antena/local/client

       

      @Templated("/src/main/webapp/App.html#login-form")

      @EntryPoint

      public class App extends Composite{

                @Inject

                @DataField("username")

                private TextBox username;

       

                @EventHandler("username")

                   public void doSomethingC1(ClickEvent e) {

                     Window.alert("sonali");

                   }

       

                @Inject

                @DataField("submit")

                Button submit;

       

                @EventHandler("submit")

                public void onClick(ClickEvent e){

                          System.out.println("submit button clicked");

       

                }

      }

       

      But nothing is working , can anyone guide me where I am going wrong?