1 Reply Latest reply on Jun 2, 2010 3:18 AM by Ilya Shaikovsky

    Adding empty String as SelectItem to rich:comboBox

    Leonid Sokolin Newbie

      I have noticed that I couldn't add empty String as SelectItem to rich:comboBox.

       

      After I do that, it stops showing all values for this combo box.

       

      For example, I have the following Java code to populate combo box with values:

       

              private List<SelectItem> templateOwnersList =

      new Vector<SelectItem>();

       

              private String templateOwner;

              ...

       

       

      //  templateOwnersList.add(new SelectItem("", ""));

       

      templateOwnersList = new Vector<SelectItem>();

       

      final List<String> owners = templateMgr.getTemplateOwners();

       

      for ( final String curOwner : owners)

      {

       

           templateOwnersList.add(new SelectItem(curOwner, curOwner));

      }

       

      Commented line makes all added values unavailable.

       

      Front end is as follows:

       

          

      <

       

      rich:comboBox id="owner" width="160" value="#{qtBeanParam.templateOwner}" enableManualInput="false" >

       

       

       

      <f:selectItems id="templateOwnerList" value="#{qtBeanParam.templateOwnersList}" />

       

       

      </rich:comboBox>

       

      Would appreciate, if somebody would explain, if it is indeed a bug.