details:   /erp/devel/pi/rev/8bdbcd377ff6
changeset: 12259:8bdbcd377ff6
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Fri May 20 05:22:19 2011 +1100
summary:   Fixes issue 17251: Do not show focused fields when the real focus is 
in another level

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
             |  24 ++++++++-
 
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
 |   2 +
 2 files changed, 23 insertions(+), 3 deletions(-)

diffs (54 lines):

diff -r 127a6fed9e9e -r 8bdbcd377ff6 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
      Fri May 20 04:00:24 2011 +1100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
      Fri May 20 05:22:19 2011 +1100
@@ -566,7 +566,7 @@
   
   setViewFocus: function(){
     
-    var object, functionName;
+    var object, functionName, items, item, i;
     
     // clear for a non-focusable item
     if (this.lastFocusedItem && !this.lastFocusedItem.getCanFocus()) {
@@ -582,9 +582,27 @@
     } else if (this.lastFocusedItem) {
       object = this.lastFocusedItem;
       functionName = 'focusInItem';
-    } else if (this.viewGrid && !this.isShowingForm) {
+    } else if (this.viewGrid && !this.isShowingForm && 
this.viewGrid.getFilterEditor() && 
this.viewGrid.getFilterEditor().getEditForm()) {
+      // there is a filter editor
+      object = this.viewGrid.getFilterEditor().getEditForm();
+      
+      // compute a focus item
+      if (!object.getFocusItem()) {
+        items = object.getItems();
+
+        for (i = 0; i < items.length; i++) {
+          item = items[i];
+          if (item.getCanFocus() && !item.isDisabled()) {
+            object.setFocusItem(item);
+            break;
+          }
+        }
+      }
+      
+      functionName = 'focus';
+    } else if (this.viewGrid) {
       object = this.viewGrid;
-      functionName = 'focusInFilterEditor';
+      functionName = 'focus';
     }
     
     isc.Page.setEvent(isc.EH.IDLE, object, isc.Page.FIRE_ONCE, functionName);
diff -r 127a6fed9e9e -r 8bdbcd377ff6 
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
--- 
a/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
  Fri May 20 04:00:24 2011 +1100
+++ 
b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
  Fri May 20 05:22:19 2011 +1100
@@ -47,6 +47,8 @@
   }
 });
 
+isc.StaticTextItem.getPrototype().getCanFocus = function() {return false;};
+
 // NOTE BEWARE: methods/props added here will overwrite and NOT extend FormItem
 // properties! 
 isc.FormItem.addProperties({

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to