4 Replies Latest reply on Aug 9, 2006 6:03 AM by Ypatios Asmanidis

    Problem with forms

    Ypatios Asmanidis Newbie

      I have two entity classes users and names with a onetomany relation...the problem is that when I have this names entity in my form when I hit submit nothing happens. If I have only the users in my form everything goes well. The submit action calls the registerUser.register method...anyone can explain me what am I doing wrong..?There is no error messages in jboss btw..

      my register.xhtml page

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      <html xmlns="http://www.w3.org/1999/xhtml"
      this text won't be displayed
      <ui:composition template="extras/template.xhtml">
      <ui:define name="title">
       Registration Form
      <ui:define name="body">
       <h:form id="testForm">
       <table border="0">
       <td><h:inputText value="#{names.lastname}" /></td>
       <td><h:inputText value="#{names.firstname}" /></td>
       <td><h:inputText value="#{names.middlename}" /></td>
       <td><h:inputText value="#{author.gender}" /></td>
       <td><h:inputText value="#{author.title}" /></td>
       <td>Year Of Birth</td>
       <td><h:inputText value="#{author.yearOfBirth}" /></td>
       <td><h:inputText value="#{author.url}" /></td>
       <td><h:inputText value="#{author.email}" /></td>
       <td><h:inputText value="#{author.keywords}" /></td>
       <td><h:inputText value="#{author.password}" /></td>
       <td>Retype Password</td>
       <td><h:inputText value="#{author.retypePassword}" /></td>
       <td>Secret Question</td>
       <td><h:inputText value="#{author.secretQuestion}" /></td>
       <td>Secret Answer</td>
       <td><h:inputText value="#{author.secretAnswer}" /></td>
       </tr> -->
       <td><h:commandButton type="Submit" value="Submit" action="#{registerAuthor.register}" /></td>

      my ejb class
      package uai.entities;
      import java.io.Serializable;
      import javax.persistence.Entity;
      import javax.persistence.GeneratedValue;
      import javax.persistence.Id;
      import javax.persistence.JoinColumn;
      import javax.persistence.ManyToOne;
      import javax.persistence.Table;
      import org.hibernate.validator.NotNull;
      import org.jboss.seam.ScopeType;
      import org.jboss.seam.annotations.Scope;
      public class AuthorName implements Serializable {
       private static final long serialVersionUID = 7854278207664893998L;
       private String lastname;
       private String firstname;
       private String middlename;
       private Long id;
       public Long getId() {
       return id;
       public void setId(Long id) {
       this.id = id;
       public String getMiddlename() {
       return middlename;
       public void setMiddlename(String middlename) {
       this.middlename = middlename;
       public String getFirstname() {
       return firstname;
       public void setFirstname(String name) {
       this.firstname = name;
       public String getLastname() {
       return lastname;
       public void setLastname(String surname) {
       this.lastname = surname;

      and my registerAuthor class

      package uai.blogic;
      import javax.ejb.Remove;
      import javax.ejb.Stateful;
      import javax.interceptor.Interceptors;
      import javax.persistence.EntityManager;
      import javax.persistence.PersistenceContext;
      import org.jboss.seam.annotations.Create;
      import org.jboss.seam.annotations.Destroy;
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Logger;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Out;
      import org.jboss.seam.annotations.Scope;
      import org.jboss.seam.core.FacesMessages;
      import org.jboss.seam.ejb.SeamInterceptor;
      import org.jboss.seam.log.Log;
      import uai.entities.AuthorName;
      import uai.entities.testObject;
      import static org.jboss.seam.ScopeType.EVENT;
      public class RegisterAuthor implements Register {
       private Log log;
       private transient FacesMessages facesMessages;
       @In @Out
       private AuthorName authorName;
       //@In @Out
       //private uai.entities.AuthorUser author;
       private EntityManager em;
       public String register() {
       log.info("hi there");
       //log.info("authorname : "+this.author.getEmail());
       return "/registered.xhtml";
       public void destroy() {
       //log.info("destroyed (register)");