0 Replies Latest reply on Sep 18, 2008 5:59 AM by George Varghese

    Combobox Data population issue

    George Varghese Newbie
      I have a User Registration Form for entering user details. In this form there is one field for setting User Group,
      I am able to populate the values into the combo box(from the database) but when i submit the form ,an exception occurs and i didn't get the combobox selected user group value .

      INFO [lifecycle] WARNING: FacesMessage(s) have been enqueued, bu
      may not have been displayed.
      sourceId = j_id10:j_id46[severity=(ERROR 2), summary=(value is required), detail
      value is required)]

      Please help me to solve this problem....

      Combo box xhtml code:

      <h:selectOneMenu name="group" id="userGroupId" value="#{userBean.userGroupId}" tabindex="4" >

      <s:selectItems value="#{groups}" var="group"  label="#{group.groupReferenceId}" itemValue="#{group}" noSelectionLabel="-- Select Group --" />
      Action Class:-

      public class UserAction implements User, Serializable{
              private GroupBean groupBean = null;
              private EntityManager em = null;
              private static Log log = null;
              private List<GroupBean> groups = null;
              private transient FacesContext facesContext;

              public String addUser() {
                      userBo = new UserBO();
                      groups = em.createQuery("select group from
                               GroupBean group").getResultList();
                      return "addUser";

              @Destroy @Remove
              public void destroy() {

                                                                              Entity Bean:--

      public class GroupBean implements Serializable{
              private static final long serialVersionUID = 1L;
              private String groupId = null;
          private String groupReferenceId = null;

              public GroupBean() {
              public GroupBean(String groupId, String groupReferenceId){
                      this.groupId = groupId;
                      this.groupReferenceId = groupReferenceId;
              @Id @GeneratedValue
              public String getGroupId() {
                      return groupId;
              public void setGroupId(String groupId) {
                      this.groupId = groupId;
              public String getGroupReferenceId() {
                      return groupReferenceId;
              public void setGroupReferenceId(String groupReferenceId) {
                      this.groupReferenceId = groupReferenceId;