4 Replies Latest reply on Aug 20, 2009 9:35 AM by filipe feijao

    <rich:suggestionbox issue

    filipe feijao Newbie

      Hi all,

      I am trying to implement a rich:suggestionbox but it doesn't work as expected.

      When I insert the first letter, it automatically gets all the option, but the "selection box" doesn't appear and the options aren't selectable.

      My .xhtml code is:

      <h:panelGrid columns="2">
      <h:outputText style="font-weight: bold;width:100px" value="Network Op.: " />
      <h:inputText id="OPBox" readonly="false" value="#{processingBean.ID}" />
      </h:panelGrid>
      <rich:suggestionbox id="suggestionBoxId" for="OPBox" suggestionAction="#{processingBean.complemento}" var="result">
      <h:column>
      <h:outputText value="#{result.ID}"/>
      </h:column>
      <a4j:support event="onselect" reRender="OPBox">
      <f:setPropertyActionListener target="#{processingBean.ID}" value="#{result.ID}"/>
      </a4j:support>
      </rich:suggestionbox>

      Bean code is:

      public List complemento(Object event){
      String prefixo = event.toString().toLowerCase();
      List retorno = new ArrayList();
      for(int pos = 0; pos < netOpeList.size(); pos++){
      if(netOpeList.get(pos).getID().toLowerCase().startsWith(prefixo)){
      retorno.add(netOpeList.get(pos));
      }
      }
      return retorno;
      }

      public List getNetOpeList() throws Exception {
      if (netOpeList==null)
      setNetOpeList(Get_Ope_Net());
      return netOpeList;
      }

      public void setNetOpeList(List netOpeList) {
      this.netOpeList = netOpeList;
      }

      Do you understand what is missing?

      Thank you in advance.