0

I want to invoke method of ViewScoped bean when some h:link is clicked (or opened in new tab or window) before faces servlet begins to handle GET request.

I have a lot of ViewScoped beans for different pages and when I go from one to another I need the first one to put its state into some pocket and the second page to get state from pocket and save it as parent's state.

For h:commandLink there is an action that saves state on click. But h:commandLink cannot be opened in new tab (or can be?). So I want to use h:link in the same way but can't find a place to call method of saving state.

I've tried some manipulations with javascript and creating custom NavigationHandler but they have some drawbacks.

Is there any clear way for doing what I want?

1 Answers1

0

I would advise to see here about opening a new windows with a <h:commandLink> : h:commandLink open in new browser window

This however makes use of third-party libraries, and can be considered as a workaround more than a real solution.

Community
  • 1
  • 1
Thrax
  • 1,926
  • 1
  • 17
  • 32
  • Thank you! But it's not the option I was looking for. I want to leave the choice of opening (or not opening) a new tab on user side. – Black DemAn Nov 13 '14 at 08:38