svn commit: r1353422 - /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: r1353422 - /ofbiz/trunk/framework/images/webapp/images/fieldlookup.js

sascharodekamp
Author: sascharodekamp
Date: Mon Jun 25 08:12:17 2012
New Revision: 1353422

URL: http://svn.apache.org/viewvc?rev=1353422&view=rev
Log:
Fix a small bug with the lookupDescription: An exception was thrown when a wrong parameter string was passed.

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=1353422&r1=1353421&r2=1353422&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/fieldlookup.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/fieldlookup.js Mon Jun 25 08:12:17 2012
@@ -173,7 +173,7 @@ function initiallyCollapseDelayed() {
 /*******************************************************************************
  * Lookup Object
  ******************************************************************************/
-var Lookup = function (options) {
+var Lookup = function(options) {
  var _newInputBoxId, _lookupId, _inputBox, _lookupContainer, _backgroundCloseClickEvent;
 
  options = {
@@ -404,7 +404,7 @@ var Lookup = function (options) {
 /*******************************************************************************
  * Lookup Counter Object
  ******************************************************************************/
-var FieldLookupCounter = function () {
+var FieldLookupCounter = function() {
  this.refArr = {};
 
  this.setReference = function(key, ref) {
@@ -454,7 +454,7 @@ var GLOBAL_LOOKUP_REF = new FieldLookupC
 /*******************************************************************************
  * Button Modifier Object
  ******************************************************************************/
-var ButtonModifier = function (lookupDiv) {
+var ButtonModifier = function(lookupDiv) {
 
  function _modifySubmitButton() {
  if (!lookupDiv) {
@@ -845,7 +845,7 @@ function closeLookup() {
  * Lookup Description Helper
  ******************************************************************************/
 // load description for lookup fields
-var lookupDescriptionLoaded = function (fieldId, url, params, formName) {
+var lookupDescriptionLoaded = function(fieldId, url, params, formName) {
  this.init(fieldId, url, params, formName);
 }
 lookupDescriptionLoaded.prototype.init = function(fieldId, url, params, formName) {
@@ -859,8 +859,14 @@ lookupDescriptionLoaded.prototype.update
  if (tooltipElement.length) {// first remove current description
  tooltipElement.remove();
  }
+
+ var indexOf = this.params.indexOf("searchValueFieldName");
+ if (indexOf == -1) {
+ return;
+ }
+
  // actual server call
- var fieldName = this.params.substring(this.params.indexOf("searchValueFieldName"));
+ var fieldName = this.params.substring(indexOf);
  fieldName = fieldName.substring(fieldName.indexOf("=") + 1);
  if (jQuery("input[name=" + fieldName + "]").val()) {
  var fieldSerialized = jQuery("input[name=" + fieldName + "]", jQuery("form[name=" + this.formName + "]")).serialize();