0

After a click on a button, an action is called and create an object after that it must redirect for another application (url) and in the same time do an update for the first page with the new object. Actually i succeed to do redirection but the update doesn't work, Thanks for help.

Controleur.actionBtn

FacesContext.getCurrentInstance().addMessage(FORMULAIRE_ID,
                new FacesMessage(FacesMessage.SEVERITY_INFO, "message", "message"));
        HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
        response.setHeader("Location", url);
        response.sendRedirect(url);
RequestContext.getCurrentInstance().update(FORMULAIRE_ID);

In my page I have :

<p:commandButton id="btn" value="action" target="_blank"
                        actionListener="#{controleur.actionBtn}"
                          ajax="false">
                        </p:commandButton>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
I. Dev
  • 1
  • 1
  • Is this acceptable as dupe? http://stackoverflow.com/questions/4304132/hcommandbutton-multiple-actions-download-file-and-render-ajax-table Or this http://stackoverflow.com/questions/18333327/refresh-navigate-current-page-while-opening-downloading-file-in-new-tab-window/ – BalusC Aug 04 '15 at 15:28
  • thanks a lot, I'll try it – I. Dev Aug 04 '15 at 15:38
  • Thank you very much it works, ' ' – I. Dev Aug 05 '15 at 07:49

0 Answers0