details: /erp/devel/pi/rev/3f43472db631
changeset: 10495:3f43472db631
user: Martin Taal <martin.taal <at> openbravo.com>
date: Thu Feb 10 01:54:25 2011 +0100
summary: Solved active view not set when clicking in filter field
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-eventhandler.js
| 11 +++-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-utilities.js
| 19 +++++++
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
| 26 +--------
3 files changed, 31 insertions(+), 25 deletions(-)
diffs (91 lines):
diff -r 72ebe51eaba1 -r 3f43472db631
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-eventhandler.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-eventhandler.js
Thu Feb 10 01:38:24 2011 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-eventhandler.js
Thu Feb 10 01:54:25 2011 +0100
@@ -52,10 +52,15 @@
canvas.view.setAsActiveView();
return true;
}
- if (isc.FormItem.isA(canvas) && canvas.grid) {
+ if (isc.FormItem.isA(canvas)) {
+ var view = OB.Utilities.determineViewOfFormItem(item);
+ if (view && view.setAsActiveView) {
+ view.setAsActiveView();
+ return true;
+ }
+ }
+ if (!canvas.parentElement && canvas.grid) {
canvas = canvas.grid;
- } if (isc.FormItem.isA(canvas) && canvas.form) {
- canvas = canvas.form;
} else {
canvas = canvas.parentElement;
}
diff -r 72ebe51eaba1 -r 3f43472db631
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-utilities.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-utilities.js
Thu Feb 10 01:38:24 2011 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-utilities.js
Thu Feb 10 01:54:25 2011 +0100
@@ -21,6 +21,25 @@
// are related to opening views, opening popups, displaying yes/no, etc.
OB.Utilities = {};
+// ** {{{OB.Utilities.determineViewOfFormItem}}} **
+// Handles the different ways to find the view of a form item.
+OB.Utilities.determineViewOfFormItem = function(item) {
+ var form = item.form;
+ if (form.view) {
+ // form item in standard form
+ return form.view;
+ } else if (form.grid) {
+ // row editor form item
+ if (form.grid.view) {
+ return form.grid.view;
+ } else if (isc.isA.RecordEditor(form.grid) && form.grid.sourceWidget &&
form.grid.sourceWidget.view) {
+ // filter editor form item
+ return form.grid.sourceWidget.view;
+ }
+ }
+ return null;
+};
+
// ** {{{OB.Utilities.callAction}}} **
// Calls the action defined by the action object, if the action object has a
callback
// property, it is assumed to be a function and it is called. Otherwise the
following
diff -r 72ebe51eaba1 -r 3f43472db631
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
Thu Feb 10 01:38:24 2011 +0100
+++
b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
Thu Feb 10 01:54:25 2011 +0100
@@ -44,32 +44,14 @@
},
focus: function(form, item){
- var view = this.getView();
- if (!view) {
- return;
+ var view = OB.Utilities.determineViewOfFormItem(item);
+ if (view) {
+ view.lastFocusedItem = this;
}
- view.lastFocusedItem = this;
- },
-
- getView: function() {
- var form = this.form;
- if (form.view) {
- // form item in standard form
- return form.view;
- } else if (form.grid) {
- // row editor form item
- if (form.grid.view) {
- return form.grid.view;
- } else if (isc.isA.RecordEditor(form.grid) && form.grid.sourceWidget &&
form.grid.sourceWidget.view) {
- // filter editor form item
- return form.grid.sourceWidget.view;
- }
- }
- return null;
},
click: function() {
- var view = this.getView();
+ var view = OB.Utilities.determineViewOfFormItem(this);
if (view) {
view.lastFocusedItem = this;
// this handles the case that there was a direct click on picker icon
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits