3 Replies Latest reply on Feb 23, 2009 3:36 AM by l.fugaro

    rich:suggestionBox and f:param

    l.fugaro

      Hi to all,
      here is my scenario:
      I have a suggestionBox called SB1 which needs to be filtered not only with the standard "suggest" parameter, but it needs anotherone, called "birthDayDateParam", a date.
      The value of the parameter "birthDayDateParam" is taken from a "rich:calendar" named "birthDayDate".

      Here is some view code:

      <rich:calendar id="birthDayDate" value="#{myModel.birthDayDate}" enableManualInput="true" datePattern="dd/MM/yyyy" inputSize="10"/>
      
      ...
      <h:inputText id="descr" maxlength="30" size="30" value="#{myModel.descr}" />
      <rich:suggestionbox height="200" width="200" id="SB1" suggestionAction="#{myManager.autocomplete}" var="myObjList" for="descr" fetchValue="#{myObjList.descr}">
      <h:column> <h:outputText value="#{myObjList.code}" /></h:column>
      <h:column> <h:outputText value="#{myObjList.descr}" /></h:column>
      <f:param name="birthDayDateParam" value="#{requestParameters.birthDayDate}" />
      <a4j:support event="onselect">
      ...
      </a4j:support>
      </rich:suggestionbox>
      


      and here is my java code for "autocomplete" list:

      public List<MyObj> autocomplete(Object suggest) {
      String birthDayDateParam = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("birthDayDateParam");
      String descr = ((String)suggest) + "%";
      List<MyObj> list = getList(birthDayDateParam, descr);
      ...
      return list;
      }
      


      finally, my problem... the birthDayDateParam (in java code) it is always null!

      Where am I wrong???

      Thanks in advance,
      Luigi

        • 1. Re: rich:suggestionBox and f:param
          nbelaevski

          Hello Luigi,

          Nested f:param tags are not supported. You can use this:

          <rich:suggestionbox id="suggestionBoxId" minChars="3" for="inputID"
           tokens=",[]" usingSuggestObjects="true"
           suggestionAction="#{forum5Bean.suggest}"
           var="result"
           width="150" height="150">
           <h:column>
           <h:outputText value="#{result}" />
           </h:column>
          
           <a4j:support event="onselect">
           <f:setPropertyActionListener value="#{result.someData}" target="#{forum5Bean.o1}" />
           </a4j:support>
          
          </rich:suggestionbox>



          • 2. Re: rich:suggestionBox and f:param
            l.fugaro

            Thaks for replying mr. nbelaevski!
            I already have an a4j:support statement in my html code... my problem is to pass one more parameter to my autocomplete method, which returns my list!
            I need to filter my list with the param used to call the suggestionbox and the date entered in my rich:calendar component!

            Thanx,
            Luigi

            • 3. Re: rich:suggestionBox and f:param
              l.fugaro

              Any ideas?

              Luigi
              :)