0

I have a page1 with ajax operations and conditional rendering of components based on user activity on that page managed by a @ViewScoped bean .Now after moving to the next page say page2 which has a h:commandButton back button , the user on click should be able to access the previous page values in its final format .

The navigation is working fine but the ajax call since its done only based on the user activity on page1 iam not able to show it .so my question is how to rerender the component with ajax values + User selection in its final format .Any idea on how to implement this ? Thanks in advance

Muthu Raman
  • 154
  • 2
  • 13
  • If you are navigating from one page to another using navigation rules you are loosing `@ViewScoped` bean values, since that scoped beans are destroyed when you return something that's different to void or null. You should try to save that values in a `@SessionScoped` bean or send them as parameters to page2. – Aritz Jan 05 '13 at 11:04
  • As @Xtreme Biker pointed out, this not possible using `@ViewScoped`. Use `@SessionScoped` or if you are using `CDI` you can use `@ConversationScoped`. Demo: http://stackoverflow.com/questions/7788430/how-does-jsf-2-conversationscope-work/7792525#7792525 – Johny T Koshy Jan 05 '13 at 11:50
  • @XtremeBiker thanks for the suggestion :) As Convesration is not possible and sending of parameters between view state is also not possible , I decide to go with this solution provided by balusC http://stackoverflow.com/questions/9741778/how-and-when-to-remove-a-session-scoped-bean-in-jsf-2-0/9742891#9742891 – Muthu Raman Jan 07 '13 at 14:47
  • @johny Thanks johny for the help :) – Muthu Raman Jan 07 '13 at 14:48

0 Answers0