2 Replies Latest reply on Jul 9, 2012 3:52 PM by shadowcreeper

    What to use in Richfaces4 instead of "data" attribute?

    shadowcreeper Apprentice

      I can't find any documentation on why the behavior of the data attribute has changed in Richfaces 4 (using 4.2.1, was previously using 3.3.3).

       

      I have an a4j:commandLink like the following:

       

      {code:xml}

      <a4j:commandLink value="Text"

            execute="@this"

            data="#{myCommand.data}"

            oncomplete="handleData( event.data );">

         <f:setPropertyActionListener value="#{someBean.value}" target="#{myCommand.someValue}"/>

         <f:actionListener binding="#{myCommand}"/>

      </a4j:commandLink>

      {code}

       

      For some reason MyCommand.getData() is called twice, then MyCommand.setSomeValue(value) is called, then MyCommand.processAction(ActionEvent). Whereas it used to call MyCommand.getData() once, then MyCommand.setSomeValue(value), then MyCommand.processAction(ActionEvent), then MyCommand.getData() again, allowing the oncomplete to use the updated data.

       

      The only way I can get my command to execute before data is called is to add actionListener="#{myCommand.processAction}" to the commandLink, but then it runs before the setPropertyActionListeners and so the command fails. I've also tried it with execute="@form" but with no change in behavior (yes it is inside a form).

       

      Is there something we are supposed to use instead? Am I just doing it wrong? Please help.

       

      Thanks.