Fixes issue 26231: Auxiliary Inputs are not computed in the Tree Grid View
authorAugusto Mauch <augusto.mauch@openbravo.com>
Wed, 09 Apr 2014 22:15:13 +0200
changeset 22851 bf51ff460dc8
parent 22850 62db1949bccc
child 22852 8403924dc79d
Fixes issue 26231: Auxiliary Inputs are not computed in the Tree Grid View

Now when a record is selected in the tree grid view, the toolBar.updateButtonState() is called. This results in a FIC call in SETSESSION mode, that loads the auxiliary inputs and session attributes.

Also some changes have been done to ensure that if the tree grid view is shown, its selected record is used instead of the record selected in the standard grid.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-view-grid.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-view-grid.js	Wed Apr 09 18:38:14 2014 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-view-grid.js	Wed Apr 09 22:15:13 2014 +0200
@@ -383,6 +383,7 @@
     var selectedRecordId = this.getSelectedRecord() ? this.getSelectedRecord().id : null,
         length, tabViewPane, i;
     this.view.updateSubtabVisibility();
+    this.toolBar.updateButtonState();
     // refresh the tabs
     if (this.view.childTabSet) {
       length = this.view.childTabSet.tabs.length;
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Wed Apr 09 18:38:14 2014 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Wed Apr 09 22:15:13 2014 +0200
@@ -2094,6 +2094,8 @@
     var ret;
     if (this.isShowingForm) {
       ret = this.viewForm.getValues();
+    } else if (this.isShowingTree) {
+      ret = this.treeGrid.getSelectedRecord();
     } else if (this.isEditingGrid) {
       ret = isc.addProperties({}, this.viewGrid.getSelectedRecord(), this.viewGrid.getEditForm().getValues());
     } else {
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js	Wed Apr 09 18:38:14 2014 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js	Wed Apr 09 22:15:13 2014 +0200
@@ -1254,7 +1254,11 @@
       for (iButtonContext = 0; iButtonContext < length; iButtonContext++) {
         currentContext = buttonContexts[iButtonContext];
 
-        selectedRecords = currentContext.viewGrid.getSelectedRecords() || [];
+        if (currentContext.isShowingTree) {
+            selectedRecords = currentContext.treeGrid.getSelectedRecords() || [];
+        } else {
+            selectedRecords = currentContext.viewGrid.getSelectedRecords() || [];	
+        }
         var numOfSelRecords = 0,
             theForm = this.view.isEditingGrid ? this.view.viewGrid.getEditForm() : this.view.viewForm,
             isNew = currentContext.viewForm.isNew,