Navigation between Portlets

Hi,

I have a portlet A, where i want to navigate from view A to view B. So in my faces-config.xml, i added this navigation rule as usual :

/PortletA/viewA.view success /PortletA/viewB.view

Now, i want to be redirect to another portlet (Portlet B) from view A of portlet A, which is deploy in another portal page. Finally, I want to return to view B of portlet A from Portlet B.

Here is a sample of my code in the page bean of view A (Portlet A) to redirect to Portlet B and to be able to go directly to view B after the action is completed in Portlet B :

public String goToPortletB() {

getFacesContext().getExternalContext().redirect(“/page.portletB”);
return “success”;
}

Now, here is a sample code of the action handler in Portlet B to return to the portal page of Portlet A and to go in view B :

public void returnToPortletA() {

getFacesContext().getExternalContext().redirect(“/page.portletA”);
}

In my webMethods 7.0 server, when the method returnToPortletA() is called, I successfully get redirected to view B of portlet A but in my wM 7.1 server, i get redirected to view A (which is the default view of portlet A) not view B.

Do you have an idea what may cause this behaviour?

Thanks for the help.
Son

I reformat my message:

Hi, I have a portlet A, where I want to navigate from view A to view B. So in my faces-config.xml, I added this navigation rule as usual:

/PortletA/viewA.view success /PortletA/viewB.view

Now, I want to be redirect to another portlet (Portlet B) from view A of portlet A, which is deploy in another portal page. Finally, I want to return to view B of portlet A from Portlet B. Here is a sample of my code in the page bean of view A (Portlet A) to redirect to Portlet B and to be able to go directly to view B after the action is completed in Portlet B:

public String goToPortletB() {

getFacesContext().getExternalContext().redirect(“/page.portletB”);
return “success”;
}

Now, here is a sample code of the action handler in Portlet B to return to the portal page of Portlet A and to go in view B :

public void returnToPortletA() {

getFacesContext().getExternalContext().redirect(“/page.portletA”);
}

In my webMethods 7.0 server, when the method returnToPortletA() is called, I successfully get redirected to view B of portlet A but in my wM 7.1 server, I get redirected to view A (which is the default view of portlet A) not view B. Do you have an idea what may cause this behaviour?

Thanks for the help.
Son

In 7.0 view caching was always done in the session that is why in 7.0 when you redirect back to portletA page it displayed viewB. However this behavior was undesired in a lot of cases. So in 7.1 the behavior changed to cache view in the page flow scope, meaning if you leave the context of the portlet and then return back initial portlet view will be shown, but not the last one.

There is INIT param which you could add to the portlet to alter this behavior to use session caching. Create and set this INIT param to true in your portlet, this will revert to 7.0 caching style

com.webMethods.caf.faces.portlet.view.cache.session

This doesn’t work for me. Mine seems to be always going back to the last view visited, i.e. viewB, but I want it to always show the default view of the portlet. I am using 7.1.