details:   https://code.openbravo.com/erp/devel/pi/rev/3a3619678a3c
changeset: 22940:3a3619678a3c
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Tue May 06 10:08:33 2014 +0200
summary:   related to issue 24705: backed out grid lazy load changeset

  it was causing CI to fail

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
           |  188 +--------
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
         |   14 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-tab.js
                     |   26 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-manage-views.js
 |  115 ++---
 4 files changed, 76 insertions(+), 267 deletions(-)

diffs (truncated from 531 to 300 lines):

diff -r 2b6197ee4047 -r 3a3619678a3c 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 Tue May 06 10:04:45 2014 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 Tue May 06 10:08:33 2014 +0200
@@ -199,6 +199,11 @@
         leftMemberButtons = [],
         i, actionButton;
 
+    this.messageBar = isc.OBMessageBar.create({
+      visibility: 'hidden',
+      view: this
+    });
+
     if (this.isRootView) {
       this.buildStructure();
     }
@@ -284,18 +289,6 @@
       this.notesDataSource.destroy();
       this.notesDataSource = null;
     }
-
-    // destroy view form
-    if (this.viewForm) {
-      this.viewForm.destroy();
-      this.viewForm = null;
-    }
-
-    // destroy view grid
-    if (this.viewGrid) {
-      this.viewGrid.destroy();
-      this.viewGrid = null;
-    }
     return this.Super('destroy', arguments);
   },
 
@@ -481,11 +474,6 @@
     var me = this,
         completeFieldsWithoutImages, fieldsWithoutImages;
     if (this.tabId && this.tabId.length > 0) {
-      this.messageBar = isc.OBMessageBar.create({
-        visibility: 'hidden',
-        view: this
-      });
-
       this.formGridLayout = isc.HLayout.create({
         width: '100%',
         height: '*',
@@ -670,102 +658,14 @@
   // this
   // parent.
   addChildView: function (childView) {
+    var length, i, actionButton;
+
     if ((childView.isTrlTab && OB.PropertyStore.get('ShowTrl', this.windowId) 
!== 'Y') || (childView.isAcctTab && OB.PropertyStore.get('ShowAcct', 
this.windowId) !== 'Y')) {
       return;
     }
 
-    childView.parentView = this;
-    childView.parentTabSet = this.childTabSet;
-
     this.standardWindow.addView(childView);
 
-    if (this.childTabSet.tabs.length > 0) {
-      this.prepareBasicChildView(childView);
-    } else {
-      this.prepareFullChildView(childView);
-    }
-
-
-    childView.tab = this.childTabSet.getTab(this.childTabSet.tabs.length - 1);
-    childView.tab.setCustomState(isc.OBStandardView.MODE_INACTIVE);
-
-    OB.TestRegistry.register('org.openbravo.client.application.ChildTab_' + 
this.tabId + '_' + childView.tabId, childView.tab);
-  },
-
-  prepareBasicChildView: function (childView) {
-    var me = this;
-
-    childView.isRenderedChildView = false;
-
-    var childTabDef = {
-      title: childView.tabTitle
-    };
-
-    childTabDef.pane = isc.VLayout.create({
-      isRenderedChildView: false,
-      lastCalledSizeFunction: null,
-      updateSubtabVisibility: function () {
-        return null;
-      },
-      doRefreshContents: function () {
-        return null;
-      },
-      setTopMaximum: function () {
-        this.lastCalledSizeFunction = 'setTopMaximum';
-        return null;
-      },
-      setBottomMaximum: function () {
-        this.lastCalledSizeFunction = 'setBottomMaximum';
-        return null;
-      },
-      setHalfSplit: function () {
-        this.lastCalledSizeFunction = 'setHalfSplit';
-        return null;
-      },
-      toolBar: {
-        updateButtonState: function () {
-          return null;
-        }
-      },
-
-      members: [isc.VLayout.create({})]
-    });
-
-    if (childView.showTabIf) {
-      childTabDef.pane.showTabIf = childView.showTabIf;
-      if (childView.originalShowTabIf) {
-        childTabDef.pane.originalShowTabIf = childView.originalShowTabIf;
-      }
-    }
-
-    childTabDef.pane.setAsActiveView = function () {
-      me.prepareFullChildView(childView, childTabDef);
-    };
-
-    childTabDef.pane.paneActionOnSelect = function () {
-      // If the initial load of the window makes that a child tab different 
from the first one be selected,
-      // the logic doesn't pass through the 'setAsActiveView' so the 
'prepareFullChildView' should be done
-      // on the tab selection instead.
-      me.prepareFullChildView(childView, childTabDef);
-      childTabDef.pane.parentTabSet.doHandleClick();
-    };
-
-    childTabDef.pane.destroy = function () {
-      if (childView.members.length === 0) {
-        // That means that there is nothing still loaded in the basic view
-        // so if the pane is destroyed, its childView can be destroyed too.
-        // In the other case, the full child view will handle the childView 
destruction.
-        childView.destroy();
-      }
-      return this.Super('destroy', arguments);
-    };
-
-    this.childTabSet.addTab(childTabDef);
-  },
-
-  prepareFullChildView: function (childView, tab) {
-    var length, i, actionButton, lastCalledSizeFunction;
-
     // Add buttons in parent to child. Note that currently it is only added 
one level.
     if (this.actionToolbarButtons && this.actionToolbarButtons.length > 0 && 
childView.showParentButtons) {
       length = this.actionToolbarButtons.length;
@@ -801,6 +701,9 @@
       }
     }
 
+    childView.parentView = this;
+    childView.parentTabSet = this.childTabSet;
+
     // build the structure of the children
     childView.buildStructure();
 
@@ -808,47 +711,14 @@
       title: childView.tabTitle,
       pane: childView
     };
-    if (!tab) {
-      this.childTabSet.addTab(childTabDef);
-    } else {
-      lastCalledSizeFunction = tab.pane.lastCalledSizeFunction;
-      delete tab.pane.lastCalledSizeFunction;
 
-      // Destroy the old basic child view pane since it is not needed anymore
-      tab.pane.destroy();
+    this.childTabSet.addTab(childTabDef);
 
-      this.childTabSet.setTabPane(tab, childTabDef.pane);
+    childView.tab = this.childTabSet.getTab(this.childTabSet.tabs.length - 1);
+    // start inactive
+    childView.tab.setCustomState(isc.OBStandardView.MODE_INACTIVE);
 
-      if (this.state === isc.OBStandardView.STATE_IN_MID || this.state === 
isc.OBStandardView.STATE_MID || this.state === 
isc.OBStandardView.STATE_TOP_MAX) {
-        // If the view is in the middle or maximized, set the child view (if 
exists) minimized
-        childView.setHeight('100%');
-        if (childView.members[1]) {
-          childView.members[1].setState(isc.OBStandardView.STATE_MIN);
-        } else {
-          childView.members[0].setHeight('100%');
-        }
-      } else if (lastCalledSizeFunction) {
-        // If 'setTopMaximum' or 'setBottomMaximum' or 'setHalfSplit' has been 
called in an unrendered tab,
-        // call it again now that the tab has been rendered to set the proper 
child view status
-        if (lastCalledSizeFunction === 'setTopMaximum') {
-          childView.setTopMaximum();
-        } else if (lastCalledSizeFunction === 'setBottomMaximum') {
-          childView.setBottomMaximum();
-        } else if (lastCalledSizeFunction === 'setHalfSplit') {
-          childView.setHalfSplit();
-        }
-      }
-    }
-
-    childView.isRenderedChildView = true;
-
-    if (childView.initialTabDefinition) {
-      // If there is an initial tab definition it means that there is a 
process that have set it there
-      // but since the window was not loaded yet, it has not been applied. 
Apply this tab definition now
-      // and delete the initialTabDefinition variable since it has been 
already applied.
-      OB.Personalization.applyViewDefinitionToView(childView, 
childView.initialTabDefinition);
-      delete childView.initialTabDefinition;
-    }
+    OB.TestRegistry.register('org.openbravo.client.application.ChildTab_' + 
this.tabId + '_' + childView.tabId, childView.tab);
   },
 
   setReadOnly: function (readOnly) {
@@ -1004,12 +874,8 @@
   setActiveViewProps: function (state) {
     if (state) {
       this.toolBar.show();
-      if (this.statusBar) {
-        this.statusBar.setActive(true);
-      }
-      if (this.activeBar) {
-        this.activeBar.setActive(true);
-      }
+      this.statusBar.setActive(true);
+      this.activeBar.setActive(true);
       this.setViewFocus();
       this.viewGrid.setActive(true);
       this.viewGrid.markForRedraw();
@@ -1024,12 +890,8 @@
       this.viewGrid.closeAnyOpenEditor();
 
       this.toolBar.hide();
-      if (this.statusBar) {
-        this.statusBar.setActive(false);
-      }
-      if (this.activeBar) {
-        this.activeBar.setActive(false);
-      }
+      this.statusBar.setActive(false);
+      this.activeBar.setActive(false);
       this.viewGrid.setActive(false);
       this.viewGrid.markForRedraw();
       // note we can not check on viewForm visibility as 
@@ -1170,10 +1032,8 @@
       length = this.childTabSet.tabs.length;
       for (i = 0; i < length; i++) {
         tabViewPane = this.childTabSet.tabs[i].pane;
-        if (tabViewPane.viewGrid) {
-          tabViewPane.viewGrid.setData([]);
-          tabViewPane.viewGrid.resetEmptyMessage();
-        }
+        tabViewPane.viewGrid.setData([]);
+        tabViewPane.viewGrid.resetEmptyMessage();
       }
     }
   },
@@ -1203,9 +1063,7 @@
         length = this.childTabSet.tabs.length;
         for (i = 0; i < length; i++) {
           tabViewPane = this.childTabSet.tabs[i].pane;
-          if (typeof tabViewPane.refreshMeAndMyChildViewsWithEntity === 
'function') {
-            tabViewPane.refreshMeAndMyChildViewsWithEntity(entity, 
excludedTabIds);
-          }
+          tabViewPane.refreshMeAndMyChildViewsWithEntity(entity, 
excludedTabIds);
         }
       }
     }
@@ -1382,7 +1240,7 @@
 
   setMaximizeRestoreButtonState: function () {
     // single view, no maximize or restore
-    if ((!this.hasChildTabs && this.isRootView) || !this.statusBar) {
+    if (!this.hasChildTabs && this.isRootView) {
       return;
     }
     // different cases:
diff -r 2b6197ee4047 -r 3a3619678a3c 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
       Tue May 06 10:04:45 2014 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
       Tue May 06 10:08:33 2014 +0200
@@ -347,7 +347,7 @@
   //  - They belong to the entity specified in the 'entity' parameter
   //  - They are not included in the 'excludedTabIds' list
   refreshViewsWithEntity: function (entity, excludedTabIds) {
-    if (this.view && typeof this.view.refreshMeAndMyChildViewsWithEntity === 
'function') {
+    if (this.view) {
       this.view.refreshMeAndMyChildViewsWithEntity(entity, excludedTabIds);
     }
   },
@@ -948,12 +948,6 @@
       return false;
     }
 
-    activeTabPane = activeTabSet.getTabPane(previousTabIndex);
-    if (activeTabPane.isRenderedChildView === false && 
activeTabPane.setAsActiveView) {
-      // If it is a basic child view, set as active first in order to load the 
full child view
-      activeTabPane.setAsActiveView();
-    }
-
     activeTabSet.selectTab(previousTabIndex);

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to