Reputation: 169
I developed a JSF 2 application using RichFaces first and then migrated to Primefaces recently.
All things are working fine except:
When clicking on a button and calling update="id1, id2, etc"
, it does not update my page contents.
<p:commandButton value="Logout" action="#{profile.logout}" />
does not work, in logout method I simply clear session and return to login page, but it stays on the same page.
I am using Tomcat 6.0.32 on Windows 7 with 4GB RAM. I m using PrimeFaces 2.2, the latest Stable build.
Upvotes: 1
Views: 3841
Reputation: 1108547
When clicking on a button and calling update="id1, id2, etc", it does not update my page contents.
You have to provide more context before we can give an answer on that. My first guesses would be that you have to remove those commas (and only separate by spaces like in standard JSF2 and RF4). My second guess would be that those components are simply not resolveable in the current component and NamingContainer
hierarchy. My third guess would be that the ajax request didn't return a valid ajax response (use Firebug to check it).
<p:commandButton value="Logout" action="#{profile.logout}" />
does not work, in logout method I simply clear session and return to login page, but it stays on the same page.
The <p:commandButton>
sends by default an ajax request. If you want to navigate to a different view as response on an ajax request, then you have to send a redirect. You can do this among others by adding the faces-redirect=true
parameter to the outcome:
return "login?faces-redirect=true";
Or, alternatively, just turn off ajax on the button:
<p:commandButton ... ajax="false" />
Or, use the standard <h:commandButton>
instead:
<h:commandButton ... />
Upvotes: 1