Author: jleroux
Date: Mon Oct 26 08:22:25 2009 New Revision: 829727 URL: http://svn.apache.org/viewvc?rev=829727&view=rev Log: A patch from Angelo Matarazzo "Add view-last-noparam" (https://issues.apache.org/jira/browse/OFBIZ-3027) - OFBIZ-3027 "view-last-noparam" has functionality of view-last but without last parameters like "request-redirect-noparam". I' m using this attribute because in my application all the screens are linked to a field in the context. that I call "commonValue". I have a link in the common header that change the value of this field but when I click this link the screen must not change but the field of current screen must be cleaned. By this attribute the view is set at " last-view" but the last parameters are cleaned. Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=829727&r1=829726&r2=829727&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Mon Oct 26 08:22:25 2009 @@ -579,7 +579,24 @@ } } renderView(viewName, requestMap.securityExternalView, request, response, null); - } else if ("view-home".equals(nextRequestResponse.type)) { + } else if ("view-last-noparam".equals(nextRequestResponse.type)) { + if (Debug.verboseOn()) Debug.logVerbose("[RequestHandler.doRequest]: Response is a view." + " sessionId=" + UtilHttp.getSessionId(request), module); + + // check for an override view, only used if "success" = eventReturn + String viewName = (UtilValidate.isNotEmpty(overrideViewUri) && (eventReturn == null || "success".equals(eventReturn))) ? overrideViewUri : nextRequestResponse.value; + + // as a further override, look for the _SAVED and then _HOME and then _LAST session attributes + if (session.getAttribute("_SAVED_VIEW_NAME_") != null) { + viewName = (String) session.getAttribute("_SAVED_VIEW_NAME_"); + } else if (session.getAttribute("_HOME_VIEW_NAME_") != null) { + viewName = (String) session.getAttribute("_HOME_VIEW_NAME_"); + } else if (session.getAttribute("_LAST_VIEW_NAME_") != null) { + viewName = (String) session.getAttribute("_LAST_VIEW_NAME_"); + } else if (UtilValidate.isNotEmpty(nextRequestResponse.value)) { + viewName = nextRequestResponse.value; + } + renderView(viewName, requestMap.securityExternalView, request, response, null); + } else if ("view-home".equals(nextRequestResponse.type)) { if (Debug.verboseOn()) Debug.logVerbose("[RequestHandler.doRequest]: Response is a view." + " sessionId=" + UtilHttp.getSessionId(request), module); // check for an override view, only used if "success" = eventReturn |
Free forum by Nabble | Edit this page |