1

How can i make sure that the action of this commandButton is completed, before I go to the next page?

<a4j:commandButton value="Edit Skin" render="@all"
                action="#{helloBean.setCurrentSkin(skin)}"
                onclick="window.location.href = 'resources/html/Editor.xhtml';" />
4ndro1d
  • 2,926
  • 7
  • 35
  • 65

1 Answers1

1

Use oncomplete instead of onclick:

oncomplete="window.location.href = 'resources/html/Editor.xhtml'"

Another approach is to redirect in your action method, by just returning string:

return "Editor.xhtml?faces-redirect=true";
partlov
  • 13,789
  • 6
  • 63
  • 82