svn commit: r946596 - /ofbiz/trunk/framework/images/webapp/images/fieldlookup.js

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r946596 - /ofbiz/trunk/framework/images/webapp/images/fieldlookup.js

jleroux@apache.org
Author: jleroux
Date: Thu May 20 11:47:30 2010
New Revision: 946596

URL: http://svn.apache.org/viewvc?rev=946596&view=rev
Log:
A patch from Sascha Rodekamp "When you get disconnected (time out) from a layered lookup, you then get afterward ugly screens" https://issues.apache.org/jira/browse/OFBIZ-3450 - OFBIZ-3450

Fixes: when user session is destroyed: Log into an application (accounting for example) and select a form - layered lookups work correct. In another tab log into another application and then log out. Then on the first tab (accounting) try to use a lookup. In the lookup screen you will get the login screen (that's OK) but once you enter your username and password you get a blank screen.

Another issue related to external key is still existing

Modified:
    ofbiz/trunk/framework/images/webapp/images/fieldlookup.js

Modified: ofbiz/trunk/framework/images/webapp/images/fieldlookup.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/fieldlookup.js?rev=946596&r1=946595&r2=946596&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/fieldlookup.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/fieldlookup.js Thu May 20 11:47:30 2010
@@ -344,6 +344,11 @@ var FieldLookupPopup = Class.create({
             parameters: { presentation : "layer" },
             onSuccess: function (transport) {
                 var lookupContent = transport.responseText;
+                //if the return screen contains the login page, the whole page have do be redirected
+                if (lookupContent.search(/loginform/) != -1) {
+                    window.location.href = window.location.href;
+                    return;
+                }
                 lookupDiv.appendChild(lookupCont);
                 lookupCont.insert({
                     bottom: "" + lookupContent + ""
@@ -361,10 +366,11 @@ var FieldLookupPopup = Class.create({
         var pageSize = this.getPageSize();
         var fadedBackground = new Element ('DIV', {
             id: GLOBAL_LOOKUP_REF.createNextKey() + "_fadedBackground",
-            class: "fadedBackground" ,
             style: "width: " + pageSize[0] + "px; height: " + pageSize[1] + "px;"
             });
-
+        fadedBackground.setAttribute("class", "fadedBackground");
+        fadedBackground.setAttribute("className", "fadedBackground");
+        
         document.body.appendChild(fadedBackground);
     },
     
@@ -756,6 +762,11 @@ function lookupAjaxRequest(request) {
         },
         onSuccess: function (transport) {
             var formRequest = transport.responseText;
+            //if the return screen contains the login page, the whole page have do be redirected
+            if (formRequest.search(/loginform/) != -1) {
+                window.location.href = window.location.href;
+                return;
+            }
             lookupContent.remove();
             var lookupCont = new Element('DIV', {
                 id: "fieldLookupContent"
@@ -788,6 +799,11 @@ function lookupFormAjaxRequest(formActio
         },
         onSuccess: function (transport) {
             var formRequest = transport.responseText;
+            //if the return screen contains the login page, the whole page have do be redirected
+            if (formRequest.search(/loginform/) != -1) {
+                window.location.href = window.location.href;
+                return;
+            }
             lookupContent.remove();
             var lookupCont = new Element('DIV', {
                 id: "fieldLookupContent"
@@ -818,6 +834,11 @@ function lookupPaginationAjaxRequest(nav
         },
         onSuccess: function (transport) {
             var formRequest = transport.responseText;
+            //if the return screen contains the login page, the whole page have do be redirected
+            if (formRequest.search(/loginform/) != -1) {
+                window.location.href = window.location.href;
+                return;
+            }
             lookupContent.remove();
             var lookupCont = new Element('DIV', {
                 id: "fieldLookupContent"