3 Replies Latest reply on Feb 23, 2009 3:36 AM by Luigi Fugaro

    rich:suggestionBox and f:param

    Luigi Fugaro Newbie

      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