2 Replies Latest reply on Apr 3, 2008 6:05 PM by nbelaevski

    ComboBox Richfaces 3.2.0.GA

    rbcdexia

      I am using the new ComboBox component.
      I have problems to do a combo using a list of entities beacause of the special characters.
      I have use CDATA and & to replace '&' character but it doesn't doesn't work.
      Can you help me, please??

      My code:
      Xhtml page:

       <rich:comboBox selectFirstOnUpdate="false" escape="false" id="entidad"
       defaultLabel="Enter some value" >
       <f:selectItems value="#{listaNombresEntidades}" />
       </rich:comboBox>
      


      Java code:
      
      @Factory(value="listaNombresEntidades",scope=ScopeType.SESSION)
       public List<SelectItem> getNombresEntidadesItem() {
      
       List<SelectItem> items = new ArrayList<SelectItem>();
      
       //items.add(new SelectItem(null,"--- Contrapartidas ---"));
      
       List<String> entidades =getEntityManager()
       .createQuery("select iic.nombre from Iic iic order by iic.nombre").getResultList();
      
       for (String entidad :entidades) {
       SelectItem aux = new SelectItem();
       aux.setValue("<![CDATA[".concat(entidad.trim()).concat("]]>"));
       if(entidad != null)
       aux.setLabel("<![CDATA[".concat(entidad.trim()).concat("]]>"));
       else
       continue;
      
       items.add(aux);
      
       }
       return items;
      
       }
      
      


      Thanks,



        • 1. Re: ComboBox Richfaces 3.2.0.GA
          rbcdexia

           

          "rbcdexia" wrote:
          I am using the new ComboBox component.
          I have problems to do a combo using a list of entities beacause of the special characters.
          I have used CDATA and & to replace '&' character but it doesn't doesn't work.
          Can you help me, please??

          My code:
          Xhtml page:
           <rich:comboBox selectFirstOnUpdate="false" escape="false" id="entidad"
           defaultLabel="Enter some value" >
           <f:selectItems value="#{listaNombresEntidades}" />
           </rich:comboBox>
          


          Java code:
          
          @Factory(value="listaNombresEntidades",scope=ScopeType.SESSION)
           public List<SelectItem> getNombresEntidadesItem() {
          
           List<SelectItem> items = new ArrayList<SelectItem>();
          
           //items.add(new SelectItem(null,"--- Contrapartidas ---"));
          
           List<String> entidades =getEntityManager()
           .createQuery("select iic.nombre from Iic iic order by iic.nombre").getResultList();
          
           for (String entidad :entidades) {
           SelectItem aux = new SelectItem();
           aux.setValue("<![CDATA[".concat(entidad.trim()).concat("]]>"));
           if(entidad != null)
           aux.setLabel("<![CDATA[".concat(entidad.trim()).concat("]]>"));
           else
           continue;
          
           items.add(aux);
          
           }
           return items;
          
           }
          
          


          Thanks,



          • 2. Re: ComboBox Richfaces 3.2.0.GA
            nbelaevski

            Hello,

            That seems to be a bug. I've filed that as: http://jira.jboss.com/jira/browse/RF-2966