Author: sascharodekamp
Date: Mon May 16 12:23:14 2011
New Revision: 1103714
URL:
http://svn.apache.org/viewvc?rev=1103714&view=revLog:
parse javascript link wrongly in lookup layer dialog if there's slash '/' in data (
https://issues.apache.org/jira/browse/OFBIZ-4281)
e.g. in lookup dialog (in layer mode), one href value of a link is "javascript:set_value('123/ABC');", then the ofbiz framework will parse it to "javascript:lookupAjaxRequest('ABC'');&presentation=layer')". It's wrong. Correct one should be given href itself.
to fix:
judge whether the link contains "javascript:set_" before split it by slash '/'.
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=1103714&r1=1103713&r2=1103714&view=diff==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/fieldlookup.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/fieldlookup.js Mon May 16 12:23:14 2011
@@ -540,7 +540,7 @@ function modifySubmitButton (lookupDiv)
var link = cellElement.href;
var liSub = link.substring(link.lastIndexOf('/')+1,(link.length));
if (liSub.indexOf("javascript:set_") != -1) {
- cellElement.href = liSub;
+ cellElement.href = link;
} else {
cellElement.href = "javascript:lookupAjaxRequest('" + liSub + "&presentation=layer')";
}
@@ -567,7 +567,7 @@ function modifySubmitButton (lookupDiv)
var link = cellChild[child].href;
var liSub = link.substring(link.lastIndexOf('/')+1,(link.length));
if (liSub.indexOf("javascript:set_") != -1) {
- cellChild[child].href = liSub;
+ cellChild[child].href = link;
} else {
cellChild[child].href = "javascript:lookupAjaxRequest('" + liSub + "&presentation=layer')";
}