Author: jleroux
Date: Wed May 19 07:32:30 2010 New Revision: 946068 URL: http://svn.apache.org/viewvc?rev=946068&view=rev Log: "Applied fix from trunk for revision: 946061" ------------------------------------------------------------------------ r946061 | jleroux | 2010-05-19 09:26:08 +0200 (mer. 19 mai 2010) | 1 ligne A patch from Atul Vani (modified from a Sascha Rodekamp's patch) "Allow to open a layer lookup from a layer lookup recursively" (https://issues.apache.org/jira/browse/OFBIZ-3693) - OFBIZ-3693 ------------------------------------------------------------------------ Modified: ofbiz/branches/release10.04/ (props changed) ofbiz/branches/release10.04/framework/images/webapp/images/fieldlookup.js Propchange: ofbiz/branches/release10.04/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed May 19 07:32:30 2010 @@ -1,3 +1,3 @@ /ofbiz/branches/addbirt:831210-885099,885686-886087 /ofbiz/branches/multitenant20100310:921280-927264 -/ofbiz/trunk:939988,939990,939999,940025,940053,940234,940248,940309,940401,940410,940425,940779,940815,940849,941007,941047,941109,941177,941199,941261,941440,941600,941999,942084,942406,942414,942671,942883-942884,943168,943271-943272,944614,944621,944623,944647,944669,944797,944895,945010,945018,945026,945118,945573,945578,945580,945582,945610,945619,945848,945852,945857 +/ofbiz/trunk:939988,939990,939999,940025,940053,940234,940248,940309,940401,940410,940425,940779,940815,940849,941007,941047,941109,941177,941199,941261,941440,941600,941999,942084,942406,942414,942671,942883-942884,943168,943271-943272,944614,944621,944623,944647,944669,944797,944895,945010,945018,945026,945118,945573,945578,945580,945582,945610,945619,945848,945852,945857,946061 Modified: ofbiz/branches/release10.04/framework/images/webapp/images/fieldlookup.js URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/images/webapp/images/fieldlookup.js?rev=946068&r1=946067&r2=946068&view=diff ============================================================================== --- ofbiz/branches/release10.04/framework/images/webapp/images/fieldlookup.js (original) +++ ofbiz/branches/release10.04/framework/images/webapp/images/fieldlookup.js Wed May 19 07:32:30 2010 @@ -596,15 +596,28 @@ function modifySubmitButton (lookupDiv) var lookupForm = null; for (var i = 0; i < forms.length; i++) { if (! isEmpty(forms[i].getAttribute('id'))) { - lookupForm = $(forms[i].getAttribute('id')); + lookupForm = $(forms[i]); } } if (lookupForm == null) { return; } + + //set new form name and id + oldFormName = lookupForm.getAttribute('name'); + lookupForm.setAttribute('name', 'form_' + GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).globalRef); + lookupForm.setAttribute('id', 'form_' + GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).globalRef); + lookupForm = $('form_' + GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).globalRef); + + //set new links for lookups + var newLookups = $A(lookupDiv.getElementsByClassName('field-lookup')); + newLookups.each(function(newLookup){ + var link = newLookup.getElementsByTagName('a')[0].href; + newLookup.getElementsByTagName('a')[0].href = String.replace(link, 'document.'+oldFormName, 'document.'+'form_' + GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).globalRef); + }); - //diable the form action + //disable the form action var formAction = lookupForm.getAttribute('action'); lookupForm.setAttribute('action', ''); @@ -612,13 +625,14 @@ function modifySubmitButton (lookupDiv) for (var i = 0; i < lookupForm.length; i++) { var ele = lookupForm.elements[i]; if ((ele.getAttribute('type')) == "submit") { + ele.style.display = "none"; var txt = ele.value; var submit = new Element('A', { id: 'lookupSubmitButton' }); submit.onclick = function () { - lookupFormAjaxRequest(formAction, lookupForm.getAttribute('id')); + lookupFormAjaxRequest(formAction, lookupForm.id); return false; }; submit.setAttribute("class", "smallSubmit"); @@ -630,7 +644,7 @@ function modifySubmitButton (lookupDiv) ele.parentNode.appendChild(submit); Event.observe(document, "keypress", function (evt) { if (Event.KEY_RETURN == evt.keyCode) { - lookupFormAjaxRequest(formAction, lookupForm.getAttribute('id')); + lookupFormAjaxRequest(formAction, lookupForm.id); } }); ele.parentNode.removeChild(ele); @@ -646,7 +660,7 @@ function modifySubmitButton (lookupDiv) var select = eleChild[k].getElementsByTagName("SELECT"); if (link.length > 0) { - link[0].href = "javascript:lookupPaginationAjaxRequest('" + link[0].href + "', '" + lookupForm.getAttribute('id') + "', 'link')"; + link[0].href = "javascript:lookupPaginationAjaxRequest('" + link[0].href + "', '" + lookupForm.id + "', 'link')"; } else if (select.length > 0) { try { var oc = select[0].getAttribute("onchange"); @@ -660,7 +674,7 @@ function modifySubmitButton (lookupDiv) var viewSize = select[0].value; var spl = ocSub.split(searchPattern); select[0].onchange = function () { - lookupPaginationAjaxRequest(spl[0] + this.value + spl[1], lookupForm.getAttribute('id'), 'select'); + lookupPaginationAjaxRequest(spl[0] + this.value + spl[1], lookupForm.id, 'select'); }; } else if (searchPattern2.test(ocSub)) { ocSub = ocSub.replace(searchPattern2, ""); @@ -668,12 +682,12 @@ function modifySubmitButton (lookupDiv) ocSub.replace(searchPattern, viewSize); } select[0].onchange = function () { - lookupPaginationAjaxRequest(ocSub + this.value, lookupForm.getAttribute('id'), 'select'); + lookupPaginationAjaxRequest(ocSub + this.value, lookupForm.id, 'select'); }; } } else { var ocSub = oc.substring((oc.indexOf('=') + 1),(oc.length - 1)); - select[0].setAttribute("onchange", "lookupPaginationAjaxRequest(" + ocSub + ", '" + lookupForm.getAttribute('id') +"')"); + select[0].setAttribute("onchange", "lookupPaginationAjaxRequest(" + ocSub + ", '" + lookupForm.id +"')"); } } catch (ex) { @@ -838,7 +852,7 @@ function setSourceColor(src) { // function passing selected value to calling window function set_value (value) { if(GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP)){ - obj_caller.target = $(GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).parentTarget.id); + obj_caller.target = $(GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).parentTarget); } else{ obj_caller.target = obj_caller.targetW; |
Free forum by Nabble | Edit this page |