I have a problem in controlling the PortletMode back to
View after changing the preferences; on a Save or Back button;
Note: navigation works but if you return to /web/guest/home you'll see the EDIT page
I tried several things;
#1 Override com.sun.faces.portlet.FacesPortlet's processAction;
1
2public void processAction(ActionRequest request, ActionResponse response) throws IOException, PortletException {
3 PortletMode portletmode = request.getPortletMode();
4 if (PortletMode.EDIT.equals(portletmode)) {
5 response.setPortletMode(PortletMode.VIEW);
6 } else if (PortletMode.HELP.equals(portletmode)) {
7 response.setPortletMode(PortletMode.VIEW);
8 }
9
10 super.processAction(request, response);
11
12 }
To some extend this works but only if you 'Save' to the same page eg return on action = "" and then press Back.
1public String doSaveEditPage() {return "";}
1public String doBackEditPage() {return "toview";}
#2 set ActionResponse from FacesContext
1protected void setPortletModeToView() {
2 ActionResponse action_response = (ActionResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
3 action_response.setPortletMode(PortletMode.VIEW);
4
5}
Even example portlets like guessnumber show same problems;
Anyone please it's driving me crazy!

using
jsf-api_1.1.jar (1.1_02-b08) Sun
jsf-impl_1.1.jar (1.1_02-b08) Sun
jsf-portlet_1.1.jar (1.1.6) Sun