2 Replies Latest reply on Feb 4, 2009 1:12 PM by leiras

    Workaround on jsFunction + actionparam

      Hi all, i have the following code:

      <a4j:commandLink id="cm1" onclick="javascript:showParameter('abc');" value="test"/>
      
      <a4j:jsFunction name="showParameter" actionListener="#{telaCodigo.showTestParameter}">
      <a4j:actionparam name="param1" assignTo="#{telaCodigo.testParameter}" />
      </a4j:jsFunction>
      
      
      public void showTestParameter(ActionEvent event) throws Exception {
      System.out.println(this.testParameter);
      }
      


      When i click on commandLink, the value 'abc' should be assigned to telaCodigo.testParameter.
      But this happens only after the second click. On the first click, the value of telaCodigo.testParameter is null.
      I read some thing about a workaround to fix it.
      Could anyone explain me how can i do that?
      Thanks a lot!