Added generic isFocusable method
authorMartin Taal <martin.taal@openbravo.com>
Sat, 15 Jan 2011 16:54:49 +0100
changeset 9835 a47e350ebb20
parent 9834 907df7d3c340
child 9836 64209940bdbd
Added generic isFocusable method
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	Sat Jan 15 16:53:27 2011 +0100
+++ b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js	Sat Jan 15 16:54:49 2011 +0100
@@ -62,8 +62,15 @@
     return;
   },
   
-  isDisabled: function() {
+  isDisabled: function(){
     return this.form.readOnly;
+  },
+  
+  // return all relevant focus condition
+  isFocusable: function(){
+    return this.canFocus && this.isDrawn() &&
+    this.isVisible() &&
+    !this.isDisabled();
   }
 });