2 Replies Latest reply on Apr 21, 2010 7:25 AM by tifrs

    Help with Request Parameters

      I noticed a problem when trying to pass parameters from a command button to a Java method.

       

      I am using f:param to specify my parameter:

       

      <h:commandButton
        action="#{bean[action]}"
        immediate="#{empty immediate ? false : immediate}"
        rendered="#{empty rendered ? true : rendered}"
        styleClass="button button-delete width_10"
        value="#{msg['general.delete']}">
        <f:param name="deleteButtonIndex" value="#{index}" />
       </h:commandButton>
      

       

       

      The corresponding action looks like this:

       

      public synchronized String removeBranch()
       {
        String value = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(REMOVE_BRANCH_ID_PARAMETER_KEY);
        int index = Integer.parseInt(value);
        ...
      }
      

       

       

      In my portlet declaration I have set the "preserveActionParams"-parameter to true like this:

       

      <init-param>
         <name>javax.portlet.faces.preserveActionParams</name>
         <value>true</value>
      </init-param>
      

       

       

      I know for sure that it worked in the past but since recently when the action method is called the parameter is always null. Does anybody know why?

      The only thing I can think of that has changed is that we have switched to Portlet Bridge 2.0 CR1 recently. I just can't verify this as the cause of this issue because we rely on 2.0 for richfaces compatibility so switching back is no option.

       

      Can anonyone please tell me how to fix this issue or maybe verify that this is a common problem with portlet bridge 2.0? I am quite desperate because we rely on this feature and I can't think of any workaround :-(

       

      Many thanks!