2 Replies Latest reply on Nov 25, 2010 7:01 AM by spiritfox26

    why rich:combobox show in the screen itemValue?

    spiritfox26

      I' try to use this component, but rich:combobox show itemValue instead itemLabel?

       

      What i doing wrong?

       

      Sin título-1.png

       

      The code:

       

       

      <rich:comboBox id="usuarioReclama" selectFirstOnUpdate="false" defaultLabel="Enter some value"
      readonly="#{incidenteEditBean.readOnly}" width="220px" style="text-align: left;">
                                            <f:selectItems value="#{incidenteEditBean.usuariosReclamantesList}" />
                                        </rich:comboBox>
      <rich:comboBox id="usuarioReclama" selectFirstOnUpdate="false" defaultLabel="Enter some value"
           readonly="#{incidenteEditBean.readOnly}" width="220px" style="text-align: left;">
           <f:selectItems value="#{incidenteEditBean.usuariosReclamantesList}" />
      </rich:comboBox>
      

       

       

       

       

       

      private List<SelectItem> wrapAsGUIListUsuariosReclamantes(List originalList) {
                List<SelectItem>  resultList = new ArrayList<SelectItem>();
                for (java.util.Iterator iter = originalList.iterator(); iter.hasNext();) {
                     Usuario usuario = (Usuario) iter.next();
                     SelectItem item = new SelectItem();
                     item.setLabel(usuario.getNomUsuario());
                     item.setValue(Integer.toString(usuario.getIdUsuario()));
                     resultList.add(item);
                }
                return resultList;
           }
      
      
      
      public List<SelectItem> getUsuariosReclamantesList() {
                return wrapAsGUIListUsuariosReclamantes(this.usuariosReclamantesList);
           }
      
           public void setUsuariosReclamantesList(List<Usuario> usuariosList) {
                this.usuariosReclamantesList = usuariosList;
           }
      
      
        • 1. Re: why rich:combobox show in the screen itemValue?
          ilya_shaikovsky

          It's really old "issue" which actually works as designed We probably used bad name for a component.. It's not a select actually. It's an input but with client side suggestions (as you see it allows to type anything even not from the list). So it supports only Value from selectItem and in general selectItem support was added only for simple declarative page definitions of suggestion strings.

           

          In RF 4 we solved that by providing different component with the same direct editing capability - one pure select (allows choosing from the list only but allows direct editing for simpler filtering) and the second - autocomplete which unifies ajax suggestionBox and client comboBox from 3.3.3.

          • 2. Re: why rich:combobox show in the screen itemValue?
            spiritfox26

            Thanks for your answer!

             

            Regards