fixed bug 0000436 : Set focus for required blank fields
authorAsier Lostalé <asier.lostale@openbravo.com>
Mon, 26 May 2008 11:57:46 +0000
changeset 1029 6293775928cd
parent 1028 8b85368639cc
child 1030 a7adcaca807d
fixed bug 0000436 : Set focus for required blank fields
src-wad/src/org/openbravo/wad/controls/WADControlJSValidation.html
src-wad/src/org/openbravo/wad/controls/WADDateJSValidation.html
src-wad/src/org/openbravo/wad/controls/WADGrid.java
src-wad/src/org/openbravo/wad/controls/WADImageJSValidation.html
src-wad/src/org/openbravo/wad/controls/WADIntegerJSValidation.html
src-wad/src/org/openbravo/wad/controls/WADLinkJSValidation.html
src-wad/src/org/openbravo/wad/controls/WADList.java
src-wad/src/org/openbravo/wad/controls/WADMemoJSValidation.html
src-wad/src/org/openbravo/wad/controls/WADNumberJSValidation.html
src-wad/src/org/openbravo/wad/controls/WADPAttribute.java
src-wad/src/org/openbravo/wad/controls/WADSearch.java
src-wad/src/org/openbravo/wad/controls/WADString.java
src-wad/src/org/openbravo/wad/controls/WADTime.java
--- a/src-wad/src/org/openbravo/wad/controls/WADControlJSValidation.html	Mon May 26 11:32:48 2008 +0000
+++ b/src-wad/src/org/openbravo/wad/controls/WADControlJSValidation.html	Mon May 26 11:57:46 2008 +0000
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -20,7 +20,7 @@
 
 <FIELD_TMP>
   if (inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)==null || inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)=="") {
-    setFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>);
+    setWindowElementFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>);
     mensaje(1);
     return false;
   }
--- a/src-wad/src/org/openbravo/wad/controls/WADDateJSValidation.html	Mon May 26 11:32:48 2008 +0000
+++ b/src-wad/src/org/openbravo/wad/controls/WADDateJSValidation.html	Mon May 26 11:57:46 2008 +0000
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -21,14 +21,14 @@
 <FIELD_TMP>
 <FIELD_TMP id="isMandatory">
   if (inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)==null || inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)=="") {
-    setFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>);
+    setWindowElementFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>);
     mensaje(1);
     return false;
   }
 </FIELD_TMP>
 <FIELD_TMP id="isValueCheck">
   if (inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)!=null && inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)!="" && (<FIELD_TMP id="isValueMin">datecmp(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>.value, '<PARAMETER_TMP id="fieldValueMin"/>', frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>.getAttribute('displayformat'))<0</FIELD_TMP><PARAMETER_TMP id="fieldJoin"/><FIELD_TMP id="isValueMax">datecmp(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>.value, '<PARAMETER_TMP id="fieldValueMax"/>', frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>.getAttribute('displayformat'))>0</FIELD_TMP>)) {
-    setFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)
+    setWindowElementFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)
     mensaje(9);
     return false;
   }
--- a/src-wad/src/org/openbravo/wad/controls/WADGrid.java	Mon May 26 11:32:48 2008 +0000
+++ b/src-wad/src/org/openbravo/wad/controls/WADGrid.java	Mon May 26 11:57:46 2008 +0000
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -76,13 +76,7 @@
       text.append("  if (selectedRow==null) return true;\n");
       text.append("  if (selectedRow<=0) dojo.widget.byId('").append(getData("id")).append("').goToFirstRow();\n");
       text.append("  else dojo.widget.byId('").append(getData("id")).append("').goToRow(selectedRow);\n");
-      /*text.append("  if (orderByPositions!=null && orderByPositions.length>0) {\n");
-      text.append("    var total = orderByPositions.length;\n");
-      text.append("    for (var i=0;i<total;i++) {\n");
-      text.append("      dojo.widget.byId('").append(getData("id")).append("').setSortedColumns(orderByPositions[i], orderByDirections[i]);\n");
-      text.append("    }\n");
-      text.append("  }\n");*/
-      //text.append("  dojo.widget.byId('").append(getData("id")).append("').setFocus();\n");
+      
       text.append("  return true;\n");
       text.append('}');
       addJSCode("onGridLoadDo", text.toString());
--- a/src-wad/src/org/openbravo/wad/controls/WADImageJSValidation.html	Mon May 26 11:32:48 2008 +0000
+++ b/src-wad/src/org/openbravo/wad/controls/WADImageJSValidation.html	Mon May 26 11:57:46 2008 +0000
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -20,7 +20,7 @@
 
 <FIELD_TMP>
   if (inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)==null || inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)=="") {
-    setFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>);
+    setWindowElementFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>);
     mensaje(1);
     return false;
   }
--- a/src-wad/src/org/openbravo/wad/controls/WADIntegerJSValidation.html	Mon May 26 11:32:48 2008 +0000
+++ b/src-wad/src/org/openbravo/wad/controls/WADIntegerJSValidation.html	Mon May 26 11:57:46 2008 +0000
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -21,14 +21,14 @@
 <FIELD_TMP>
 <FIELD_TMP id="isMandatory">
   if (inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)==null || inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)=="") {
-    setFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>);
+    setWindowElementFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>);
     mensaje(1);
     return false;
   }
 </FIELD_TMP>
 <FIELD_TMP id="isValueCheck">
   if (inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)!=null && inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)!="" && (<FIELD_TMP id="isValueMin">parseInt(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>.value) < parseInt('<PARAMETER_TMP id="fieldValueMin"/>')</FIELD_TMP><PARAMETER_TMP id="fieldJoin"/><FIELD_TMP id="isValueMax">parseInt(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>.value) > parseInt('<PARAMETER_TMP id="fieldValueMax"/>')</FIELD_TMP>)) {
-    setFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)
+    setWindowElementFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)
     mensaje(9);
     return false;
   }
--- a/src-wad/src/org/openbravo/wad/controls/WADLinkJSValidation.html	Mon May 26 11:32:48 2008 +0000
+++ b/src-wad/src/org/openbravo/wad/controls/WADLinkJSValidation.html	Mon May 26 11:57:46 2008 +0000
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -20,7 +20,7 @@
 
 <FIELD_TMP>
   if (inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)==null || inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)=="") {
-    setFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>);
+    setWindowElementFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>);
     mensaje(1);
     return false;
   }
--- a/src-wad/src/org/openbravo/wad/controls/WADList.java	Mon May 26 11:32:48 2008 +0000
+++ b/src-wad/src/org/openbravo/wad/controls/WADList.java	Mon May 26 11:57:46 2008 +0000
@@ -43,7 +43,7 @@
       text.append(")==null || inputValue(frm.inp");
       text.append(getData("ColumnNameInp"));
       text.append(")==\"\") {\n");
-      text.append("    setFocus(frm.inp").append(getData("ColumnNameInp")).append(");\n");
+      text.append("    setWindowElementFocus(frm.inp").append(getData("ColumnNameInp")).append(");\n");
       text.append("    mensaje(1);\n");
       text.append("    return false;\n");
       text.append("  }");
--- a/src-wad/src/org/openbravo/wad/controls/WADMemoJSValidation.html	Mon May 26 11:32:48 2008 +0000
+++ b/src-wad/src/org/openbravo/wad/controls/WADMemoJSValidation.html	Mon May 26 11:57:46 2008 +0000
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -20,7 +20,7 @@
 
 <FIELD_TMP>
   if (inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)==null || inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)=="") {
-    setFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>);
+    setWindowElementFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>);
     mensaje(1);
     return false;
   }
--- a/src-wad/src/org/openbravo/wad/controls/WADNumberJSValidation.html	Mon May 26 11:32:48 2008 +0000
+++ b/src-wad/src/org/openbravo/wad/controls/WADNumberJSValidation.html	Mon May 26 11:57:46 2008 +0000
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -21,14 +21,14 @@
 <FIELD_TMP>
 <FIELD_TMP id="isMandatory">
   if (inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)==null || inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)=="") {
-    setFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>);
+    setWindowElementFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>);
     mensaje(1);
     return false;
   }
 </FIELD_TMP>
 <FIELD_TMP id="isValueCheck">
   if (inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)!=null && inputValue(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)!="" && (<FIELD_TMP id="isValueMin">parseFloat(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>.value) < parseFloat('<PARAMETER_TMP id="fieldValueMin"/>')</FIELD_TMP><PARAMETER_TMP id="fieldJoin"/><FIELD_TMP id="isValueMax">parseFloat(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>.value) > parseFloat('<PARAMETER_TMP id="fieldValueMax"/>')</FIELD_TMP>)) {
-    setFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)
+    setWindowElementFocus(frm.inp<PARAMETER_TMP id="fieldColumnNameInp"/>)
     mensaje(9);
     return false;
   }
--- a/src-wad/src/org/openbravo/wad/controls/WADPAttribute.java	Mon May 26 11:32:48 2008 +0000
+++ b/src-wad/src/org/openbravo/wad/controls/WADPAttribute.java	Mon May 26 11:57:46 2008 +0000
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -41,7 +41,7 @@
     StringBuffer validation = new StringBuffer();
     if (getData("IsMandatory").equals("Y")) {
       validation.append("  if (inputValue(frm.inp").append(getData("ColumnNameInp")).append(")==null || inputValue(frm.inp").append(getData("ColumnNameInp")).append(")==\"\") {\n");
-      if (getData("IsDisplayed").equals("Y")) validation.append("    frm.inp").append(getData("ColumnNameInp")).append("_R.focus();\n");
+      if (getData("IsDisplayed").equals("Y")) validation.append("    setWindowElementFocus(frm.inp").append(getData("ColumnNameInp")).append("_R);\n");
       validation.append("    mensaje(1);\n");
       validation.append("    return false;\n");
       validation.append("  }\n");
--- a/src-wad/src/org/openbravo/wad/controls/WADSearch.java	Mon May 26 11:32:48 2008 +0000
+++ b/src-wad/src/org/openbravo/wad/controls/WADSearch.java	Mon May 26 11:57:46 2008 +0000
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -51,7 +51,7 @@
     StringBuffer validation = new StringBuffer();
     if (getData("IsMandatory").equals("Y")) {
       validation.append("  if (inputValue(frm.inp").append(getData("ColumnNameInp")).append(")==null || inputValue(frm.inp").append(getData("ColumnNameInp")).append(")==\"\") {\n");
-      if (getData("IsDisplayed").equals("Y")) validation.append("    frm.inp").append(getData("ColumnNameInp")).append("_R.focus();\n");
+      if (getData("IsDisplayed").equals("Y")) validation.append("    setWindowElementFocus(frm.inp").append(getData("ColumnNameInp")).append("_R);\n");
       validation.append("    mensaje(1);\n");
       validation.append("    return false;\n");
       validation.append("  }\n");
--- a/src-wad/src/org/openbravo/wad/controls/WADString.java	Mon May 26 11:32:48 2008 +0000
+++ b/src-wad/src/org/openbravo/wad/controls/WADString.java	Mon May 26 11:57:46 2008 +0000
@@ -42,7 +42,7 @@
     StringBuffer validation = new StringBuffer();
     if (getData("IsMandatory").equals("Y")) {
       validation.append("  if (inputValue(frm.inp").append(getData("ColumnNameInp")).append(")==null || inputValue(frm.inp").append(getData("ColumnNameInp")).append(")==\"\") {\n");
-      if (getData("IsDisplayed").equals("Y")) validation.append("    frm.inp").append(getData("ColumnNameInp")).append(".focus();\n");
+      if (getData("IsDisplayed").equals("Y")) validation.append("    setWindowElementFocus(frm.inp").append(getData("ColumnNameInp")).append(");\n");
       validation.append("    mensaje(1);\n");
       validation.append("    return false;\n");
       validation.append("  }\n");
--- a/src-wad/src/org/openbravo/wad/controls/WADTime.java	Mon May 26 11:32:48 2008 +0000
+++ b/src-wad/src/org/openbravo/wad/controls/WADTime.java	Mon May 26 11:57:46 2008 +0000
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -41,7 +41,7 @@
     StringBuffer validation = new StringBuffer();
     if (getData("IsMandatory").equals("Y")) {
       validation.append("  if (inputValue(frm.inp").append(getData("ColumnNameInp")).append(")==null || inputValue(frm.inp").append(getData("ColumnNameInp")).append(")==\"\") {\n");
-      if (getData("IsDisplayed").equals("Y")) validation.append("    frm.inp").append(getData("ColumnNameInp")).append(".focus();\n");
+      if (getData("IsDisplayed").equals("Y")) validation.append("    setWindowElementFocus(frm.inp").append(getData("ColumnNameInp")).append(");\n");
       validation.append("    mensaje(1);\n");
       validation.append("    return false;\n");
       validation.append("  }\n");
@@ -59,7 +59,7 @@
         validation.append("timecmp(frm.inp").append(getData("ColumnNameInp")).append(".value, '").append(getData("ValueMax")).append("')>0");
       }
       validation.append(")) {\n");
-      if (getData("IsDisplayed").equals("Y")) validation.append("    frm.inp").append(getData("ColumnNameInp")).append(".focus();\n");
+      if (getData("IsDisplayed").equals("Y")) validation.append("    setWindowElementFocus(frm.inp").append(getData("ColumnNameInp")).append(");\n");
       validation.append("    mensaje(9);\n");
       validation.append("    return false;\n");
       validation.append("  }\n");