2 Replies Latest reply on Mar 28, 2007 6:33 PM by H K

    Seam and events (really dumb one)

    Vinicius Carvalho Apprentice

      Ok, this might the the dumbest question I've ever asked. But I'm really stuck on this.
      I have other seam projects, (none using facelets tough) and they work fine.
      So I have this project: I used seam-gen to create the artifacts. I have one simple SLSB

      @Stateless
      @Name("customerManager")
      public class CustomerManagerBean implements CustomerManager {
      
       @In @Out
       private Customer customer
       @PersistenceContext(unitName="CustomerContext")
       private EntityManager em;
      
       public String register() {
       em.persist(customer);
       return null;
       }
      }
      
      @Name("customer")
      @Entity
      public class Customer implements Serializable{
      @NotNull
      private String getName()...
      }
      
      and finally my xhtml page:
      
      <ui:define name="content">
      <h:form>
      <h:messages globalOnly="true"/>
      <s:decorate template="edit.xhtml">
      <ui:define name="label">Name </ui:define> : <h:inputText value="#{customer.name}" size="15" required="true"/><br/>
      </s:decorate>
      <s:decorate template="edit.xhtml">
      <ui:define name="label">Phone </ui:define>: <h:inputText value="#{customer.phone}" size="8"/><br/>
      </s:decorate>
      <h:commandButton type="submit" value="Register" action="#{customerManager.register}"/>
      </h:form>
      </ui:define>
      

      As you can see, simpler is impossible. Hitting the Register command button does not trigger the method...
      I'm really embarrassed of how could a simple thing like this get me stuck... So I come here to call for help :(
      Anyone have a clue of what's missing?

      Best regards, and really sorry about the dumb question