6 Replies Latest reply on Aug 9, 2009 6:10 AM by Nick Belaevski

    Can I control the order of attributes in a4j:commandButton?

    Matt Kohanek Novice

      Here is the commanButton:

      <a4j:commandButton type="submit" value="SUBMIT PROJECT CHANGES" action="#{updateAllBean.updateProject}"
       actionListener="#{treeBean.reloadTree}" reRender="tree" />

      I need the actionListener to happen first, and then the reRender, but it seems that it is happening in the reverse order, reRender first, actionListener second.

      The action attribute edits the data stored on a web service. I have a rich:tree on this page to represent the data on this web service. So when you hit this submit button, I need that rich:tree to be reRendered with the newly submited data. Right now though, if I hit this submit button with the changes, it does change the data on the web service, but it reRenders the tree before the actionListener has a chance to happen.
      I know this because if I hit the submit button once, it does this, and then if I hit that submit button a second time, it does reRender the tree with the new data. So the actionListener code is correct, and reloads the tree List just fine, but I need the reRender to wait until after this happens before reRendering the tree.

      Or if there is a better way to handle this faster please let me know, because the actionListener event takes 3-5 seconds to complete so its a bit slow.