0 Replies Latest reply on Apr 14, 2006 10:34 AM by Tomasz Zab?ocki

    JSF selectOneRadio

    Tomasz Zab?ocki Newbie

      Here comes my troubling issue.

      I have a problem with selectOneRadio tag.
      When I submit a form every single field from the form stores its state - the textfields are filled, the checkboxes are checked but the radio buttons
      group lose their selection.

      This is the page code:
      <h:selectOneRadio id="type" value="#{movieControlBean.selectedType}" required="true" layout="pageDirection">
      <f:selectItems value="#{movieControlBean.types}"/>
      </h:selectOneRadio>
      <h:message for="type" errorClass="errors"/>

      This is the relied code in the movieControlBean:

      public Integer getSelectedType()
      {
      return this.selectedType;
      }
      public void setSelectedType(Integer selectedType)
      {
      this.selectedType= selectedType;
      this.selectedTypeDescription = Utils.getFilmService().getDictionary(this.selectedType).getDescription();
      }

      public SelectItem [] getTypes()
      {
      List movieTypes = service.getDictionaries("FILM_TYPE");
      types = new SelectItem[movieTypes.size()];
      int i = 0;
      for(Dictionary type : movieTypes)
      {
      types = new SelectItem(type.getDictionaryId(),type.getDescription());
      i++;
      } return types;
      }

      Any ideas?