0 Replies Latest reply on Jun 7, 2011 3:12 AM by Faisal Basra

    Problem with h:selectOneMenu and a4j:support

    Faisal Basra Newbie

      Hi, I have some problem with h:selectOneMenu. There is dependent component on h:selectOneMenu which and h:selectOneMenu is mandatory that's why marked required=true.


      Problem is when user select, default label i.e. "Please Select" which holds null value, the validation occurs and fails and method is not being called. Please suggest me how to fix this proble.


      <h:selectOneMenu id="planets" value="#{planetsMoons.currentPlanet}" valueChangeListener="#{planetsMoons.planetChanged}" required="true">

              <f:selectItems value="#{planetsMoons.planetsList}" />

              <a4j:support event="onchange" reRender="moon" />



      <h:outputText id="moon" value="#{planetsMoons.moon}">



             public List<SelectItem>  getPlanetsList(){


               // For Select

              SelectItem item = new SelectItem();


              item.setLabel("Please Select");



              // Industrial Classification from DB

              List<Plant> plantList =  this.plantDAO.findAll();



                  for (Plant plant: plantList) {

                      item = new SelectItem();