Issue 19728: Format js files org.openbravo.client.application - main
authorIván Perdomo <ivan.perdomo@openbravo.com>
Sat, 11 Feb 2012 16:19:47 +0100
changeset 15465 ba67efc3203a
parent 15464 345215765c33
child 15466 cbfa765a23c4
Issue 19728: Format js files org.openbravo.client.application - main
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-base-view.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-messagebar.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view-datasource.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/main/ob-standard-window.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-tab.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-base-view.js	Sat Feb 11 15:48:44 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-base-view.js	Sat Feb 11 16:19:47 2012 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2011 Openbravo SLU
+ * All portions are Copyright (C) 2011-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -23,7 +23,7 @@
 isc.ClassFactory.defineClass('OBBaseView', isc.Layout);
 
 isc.OBBaseView.addProperties({
-  
+
   // ** {{{ OBBaseView.showsItself }}} **
   // If this boolean property is set to true then the Openbravo view manager
   // will not place the view instance in a tab in the main Multi-Document-Interface.
@@ -31,7 +31,7 @@
   // it for example possible to define views which are implemented as 
   // popups instead of opened in the main MDI.
   showsItself: false,
-  
+
   // ** {{{ OBBaseView.isSameTab() }}} **
   // Is called by the view manager when opening a view. The view manager
   // will first check if there is already a tab open by calling the 
@@ -39,9 +39,9 @@
   // true then the requested view is opened in that tab (effectively
   // replacing the current open view there). This is needed for cases
   // when a certain view may only be opened once.
-  isSameTab: function(viewId, params){
+  isSameTab: function (viewId, params) {
     var prop;
-    
+
     for (prop in params) {
       if (params.hasOwnProperty(prop)) {
         if (params[prop] !== this[prop]) {
@@ -49,7 +49,7 @@
         }
       }
     }
-    
+
     // a common implementation does this, this allows only 
     // one instance of certain view class to be open at one point 
     // in time.
@@ -63,29 +63,29 @@
   // to the address bar. This makes it possible for the user to do 
   // back in the browser, to bookmark the url and to build history in the 
   // browser itself. 
-  getBookMarkParams: function() {
+  getBookMarkParams: function () {
     var result = {};
     result.viewId = this.getClassName();
     result.tabTitle = this.tabTitle;
     return result;
   },
-  
+
   // ** {{{ OBBaseView.getHelpView() }}} **
   // This method can return an object containing a view definition. 
   // If this method returns an object then a link is activated in the 
   // help pull-down in the top.
-  getHelpView: function(){
+  getHelpView: function () {
     return;
     // an example of returning a view definition, the viewId contains
     // the help view classname, the tabTitle denotes the tab title of the
     // help view
-//    return {
-//        viewId: 'ClassicOBHelp',
-//        tabTitle: this.tabTitle + ' - ' + OB.I18N.getLabel('UINAVBA_Help'),
-//        windowId: this.windowId,
-//        windowType: 'W',
-//        windowName: this.tabTitle
-//    };
+    //    return {
+    //        viewId: 'ClassicOBHelp',
+    //        tabTitle: this.tabTitle + ' - ' + OB.I18N.getLabel('UINAVBA_Help'),
+    //        windowId: this.windowId,
+    //        windowType: 'W',
+    //        windowName: this.tabTitle
+    //    };
   }
 
 });
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-messagebar.js	Sat Feb 11 15:48:44 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-messagebar.js	Sat Feb 11 16:19:47 2012 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2011 Openbravo SLU
+ * All portions are Copyright (C) 2011-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -24,7 +24,7 @@
 
 isc.OBMessageBarCloseIcon.addProperties({
   messageBar: null,
-  action: function(){
+  action: function () {
     this.messageBar.hide(true);
   }
 });
@@ -44,8 +44,8 @@
   mainIcon: null,
   text: null,
   closeIcon: null,
-  
-  initWidget: function(){
+
+  initWidget: function () {
     this.mainIcon = isc.OBMessageBarMainIcon.create({});
     this.text = isc.OBMessageBarDescriptionText.create({
       contents: ''
@@ -53,35 +53,35 @@
     this.closeIcon = isc.OBMessageBarCloseIcon.create({
       messageBar: this
     });
-    
+
     this.addMembers([this.mainIcon, this.text, this.closeIcon]);
   },
 
-  hideCloseIcon: function() {
+  hideCloseIcon: function () {
     this.closeIcon.hide();
   },
 
-  showCloseIcon: function() {
+  showCloseIcon: function () {
     this.closeIcon.show();
   },
 
-  setType: function(type){
+  setType: function (type) {
     if (this.setTypeStyle) {
       this.setTypeStyle(type);
     }
     this.type = type;
   },
-  
-  setText: function(title, text){
+
+  setText: function (title, text) {
     if (!title) {
       this.text.setContents(text);
     } else {
       // TODO: low-prio, move styling to a css class
-      this.text.setContents('<b>' + title + '</b>' + (text? '<br/>'+ text:''));
+      this.text.setContents('<b>' + title + '</b>' + (text ? '<br/>' + text : ''));
     }
   },
-  
-  getDefaultTitle: function(type){
+
+  getDefaultTitle: function (type) {
     if (type === isc.OBMessageBar.TYPE_SUCCESS) {
       return OB.I18N.getLabel('OBUIAPP_Success');
     } else if (type === isc.OBMessageBar.TYPE_ERROR) {
@@ -93,8 +93,8 @@
     }
     return null;
   },
-  
-  setMessage: function(type, title, text){
+
+  setMessage: function (type, title, text) {
     var i, length, newText, form, grid;
     if (this.view && this.view.viewForm) {
       form = this.view.viewForm;
@@ -113,7 +113,7 @@
       text = newText + '</ul>';
     }
 
-    if((form && form.isSaving) || (grid && grid.isSaving)) {
+    if ((form && form.isSaving) || (grid && grid.isSaving)) {
       text = OB.I18N.getLabel('OBUIAPP_ErrorSavingFailed') + ' ' + text;
     }
 
@@ -121,23 +121,23 @@
     delete this.hasFilterMessage;
     this.show();
   },
-  
+
   // calls te OB.I18N.getLabel to asynchronously get a label
   // and display it  
-  setLabel: function(type, title, label, params){
+  setLabel: function (type, title, label, params) {
     var me = this;
     OB.I18N.getLabel(label, params, {
-      setLabel: function(text){
+      setLabel: function (text) {
         me.setMessage(type, title, text);
       }
     }, 'setLabel');
   },
 
-  hide: function(force) {
+  hide: function (force) {
     // if hide is not forced, keep the message if marked as keepOnAutomaticRefresh
     if (force || !this.keepOnAutomaticRefresh) {
       delete this.keepOnAutomaticRefresh;
       this.Super('hide', arguments);
     }
   }
-});
+});
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view-datasource.js	Sat Feb 11 15:48:44 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view-datasource.js	Sat Feb 11 16:19:47 2012 +0100
@@ -26,8 +26,8 @@
 isc.OBViewDataSource.addProperties({
   additionalProps: null,
   showProgressAfterDelay: false,
-  
-  showProgress: function(editedRecord){
+
+  showProgress: function (editedRecord) {
     var btn, btn2;
 
     if (!this.showProgressAfterDelay) {
@@ -35,7 +35,7 @@
       return;
     }
 
-    if (editedRecord){
+    if (editedRecord) {
       if (editedRecord && editedRecord.editColumnLayout) {
         if (!this.view.isShowingForm) {
           editedRecord.editColumnLayout.toggleProgressIcon(true);
@@ -56,8 +56,8 @@
       btn2.markForRedraw();
     }
   },
-  
-  hideProgress: function(editedRecord){
+
+  hideProgress: function (editedRecord) {
     var btn;
     this.showProgressAfterDelay = false;
     if (editedRecord && editedRecord.editColumnLayout) {
@@ -70,8 +70,8 @@
     btn.resetBaseStyle();
     btn.markForRedraw();
   },
-  
-  performDSOperation: function(operationType, data, callback, requestProperties){
+
+  performDSOperation: function (operationType, data, callback, requestProperties) {
     var currentRecord;
 
     requestProperties = requestProperties || {};
@@ -80,7 +80,8 @@
     // only update the values of the record itself but not of any referenced 
     // entity
     if (operationType === 'update' || operationType === 'add') {
-      var correctedData = {}, prop;
+      var correctedData = {},
+          prop;
       for (prop in data) {
         if (data.hasOwnProperty(prop) && !prop.contains('.')) {
           correctedData[prop] = data[prop];
@@ -100,14 +101,13 @@
     }
 
     // doing row editing
-    if (this.view.viewGrid.getEditRow() ||
-    this.view.viewGrid.getEditRow() === 0) {
+    if (this.view.viewGrid.getEditRow() || this.view.viewGrid.getEditRow() === 0) {
       if (!requestProperties.clientContext) {
         requestProperties.clientContext = {};
       }
       requestProperties.clientContext.editRow = this.view.viewGrid.getEditRow();
     }
-    
+
     var newRequestProperties = this.getTabInfoRequestProperties(this.view, requestProperties);
     // standard update is not sent with operationType
     var additionalPara = {
@@ -123,7 +123,7 @@
     this.Super('performDSOperation', [operationType, data, callback, newRequestProperties]);
   },
 
-  getAdditionalProps: function() {
+  getAdditionalProps: function () {
     var prop, length, i, fld;
     if (this.additionalProps !== null) {
       return this.additionalProps;
@@ -145,7 +145,7 @@
   // do special id-handling so that we can replace the old if with the new
   // id
   // in the correct way, see the ob-view-grid.js editComplete method
-  validateJSONRecord: function(record){
+  validateJSONRecord: function (record) {
     record = this.Super('validateJSONRecord', arguments);
     if (record && record._originalId) {
       var newId = record.id;
@@ -154,20 +154,18 @@
     }
     return record;
   },
-  
-  transformResponse: function(dsResponse, dsRequest, jsonData){
-  
+
+  transformResponse: function (dsResponse, dsRequest, jsonData) {
+
     if (dsRequest.clientContext) {
       this.hideProgress(dsRequest.clientContext.progressIndicatorSelectedRecord);
     }
     if (jsonData) {
-      var errorStatus = !jsonData.response ||
-      jsonData.response.status === 'undefined' ||
-      jsonData.response.status !== isc.RPCResponse.STATUS_SUCCESS;
+      var errorStatus = !jsonData.response || jsonData.response.status === 'undefined' || jsonData.response.status !== isc.RPCResponse.STATUS_SUCCESS;
       if (errorStatus) {
         var handled = this.view.setErrorMessageFromResponse(dsResponse, jsonData, dsRequest);
-        
-        if (!handled && !dsRequest.willHandleError && jsonData.response && jsonData.response.error) { 
+
+        if (!handled && !dsRequest.willHandleError && jsonData.response && jsonData.response.error) {
           OB.KernelUtilities.handleSystemException(jsonData.response.error.message);
         }
       } else {
@@ -179,7 +177,7 @@
     }
     return this.Super('transformResponse', arguments);
   },
-  
+
   // ** {{{ getTabInfoRequestProperties }}} **
   //
   // Adds tab and module information to the requestProperties.
@@ -190,15 +188,15 @@
   // Return:
   // * Original requestProperties including the new module and tab
   // properties.
-  getTabInfoRequestProperties: function(theView, requestProperties){
+  getTabInfoRequestProperties: function (theView, requestProperties) {
     if (theView && theView.tabId) {
       requestProperties.params = requestProperties.params || {};
       isc.addProperties(requestProperties.params, {
-          windowId: theView.standardWindow.windowId,
-          tabId: theView.tabId,
-          moduleId: theView.moduleId
+        windowId: theView.standardWindow.windowId,
+        tabId: theView.tabId,
+        moduleId: theView.moduleId
       });
     }
     return requestProperties;
   }
-});
+});
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Sat Feb 11 15:48:44 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Sat Feb 11 16:19:47 2012 +0100
@@ -44,22 +44,31 @@
 isc.ClassFactory.defineClass('OBStandardView', isc.VLayout);
 
 isc.OBStandardView.addClassProperties({
-  STATE_TOP_MAX: 'TopMax', // the part in the top is maximized, meaning
+  // the part in the top is maximized, meaning
+  STATE_TOP_MAX: 'TopMax',
+
   // that the tabset in the bottom is minimized
-  STATE_BOTTOM_MAX: 'BottomMax', // the tabset part is maximized, the
+  // the tabset part is maximized, the
+  STATE_BOTTOM_MAX: 'BottomMax',
+
   // the top has height 0
-  STATE_MID: 'Mid', // the view is split in the middle, the top part has
+  // the view is split in the middle, the top part has
+  STATE_MID: 'Mid',
+
   // 50%, the tabset also
-  STATE_IN_MID: 'InMid', // state of the tabset which is shown in the middle,
+  // state of the tabset which is shown in the middle,
+  STATE_IN_MID: 'InMid',
+
   // the parent of the tabset has state
   // isc.OBStandardView.STATE_MID
-  STATE_MIN: 'Min', // minimized state, the parent has
+  // minimized state, the parent has
+  STATE_MIN: 'Min',
+
   // isc.OBStandardView.STATE_TOP_MAX or
   // isc.OBStandardView.STATE_IN_MID
-  
   // the inactive state does not show an orange hat on the tab button
   MODE_INACTIVE: 'Inactive',
-  
+
   UI_PATTERN_READONLY: 'RO',
   UI_PATTERN_SINGLERECORD: 'SR',
   UI_PATTERN_STANDARD: 'ST'
@@ -72,124 +81,126 @@
   // view shown directly in the main tab
   showsItself: false,
   tabTitle: null,
-  
+
   // ** {{{ windowId }}} **
   // The id of the window shown here, only set for the top view in the
   // hierarchy
   // and if this is a window/tab view.
   windowId: null,
-  
+
   // ** {{{ tabId }}} **
   // The id of the tab shown here, set in case of a window/tab view.
   tabId: null,
-  
+
   // ** {{{ processId }}} **
   // The id of the process shown here, set in case of a process view.
   processId: null,
-  
+
   // ** {{{ formId }}} **
   // The id of the form shown here, set in case of a form view.
   formId: null,
-  
+
   // ** {{{ parentView }}} **
   // The parentView if this view is a child in a parent child structure.
   parentView: null,
-  
+
   // ** {{{ parentTabSet }}} **
   // The tabSet which shows this view. If the parentView is null then this
   // is the
   // top tabSet.
   parentTabSet: null,
   tab: null,
-  
+
   // ** {{{ toolbar }}} **
   // The toolbar canvas.
   toolBar: null,
-  
+
   messageBar: null,
-  
+
   // ** {{{ formGridLayout }}} **
   // The layout which holds the form and grid.
   formGridLayout: null,
-  
+
   // ** {{{ childTabSet }}} **
   // The tabSet holding the child tabs with the OBView instances.
   childTabSet: null,
-  
+
   // ** {{{ hasChildTabs }}} **
   // Is set to true if there are child tabs.
   hasChildTabs: false,
-  
+
   // ** {{{ dataSource }}} **
   // The dataSource used to fill the data in the grid/form.
   dataSource: null,
-  
+
   // ** {{{ viewForm }}} **
   // The viewForm used to display single records
   viewForm: null,
-  
+
   // ** {{{ viewGrid }}} **
   // The viewGrid used to display multiple records
   viewGrid: null,
-  
+
   // ** {{{ parentProperty }}} **
   // The name of the property refering to the parent record, if any
   parentProperty: null,
-  
+
   // ** {{{ targetRecordId }}} **
   // The id of the record to initially show.
   targetRecordId: null,
-  
+
   // ** {{{ entity }}} **
   // The entity to show.
   entity: null,
-  
+
   width: '100%',
   height: '100%',
   margin: 0,
   padding: 0,
   overflow: 'hidden',
-  
+
   // set if one record has been selected
   lastRecordSelected: null,
   lastRecordSelectedCount: 0,
   fireOnPauseDelay: 200,
-  
+
   // ** {{{ refreshContents }}} **
   // Should the contents listgrid/forms be refreshed when the tab
   // gets selected and shown to the user.
   refreshContents: true,
-  
+
   state: isc.OBStandardView.STATE_MID,
   previousState: isc.OBStandardView.STATE_TOP_MAX,
-  
+
   // last item in the filtergrid or the form which had focus
   // when the view is activated it will set focus here
   lastFocusedItem: null,
-  
+
   // initially set to true, is set to false after the 
   // first time default edit mode is opened or a new parent 
   // is selected.
   // note that opening the edit view is done in the viewGrid.dataArrived
   // method
   allowDefaultEditMode: true,
-  
+
   readOnly: false,
   singleRecord: false,
-  
+
   isShowingForm: false,
   isEditingGrid: false,
 
-  propertyToColumns:[],
+  propertyToColumns: [],
 
-  initWidget: function(properties){
-    var length, rightMemberButtons = [], leftMemberButtons = [], i, actionButton;
-    
+  initWidget: function (properties) {
+    var length, rightMemberButtons = [],
+        leftMemberButtons = [],
+        i, actionButton;
+
     this.messageBar = isc.OBMessageBar.create({
       visibility: 'hidden',
       view: this
     });
-    
+
     if (this.isRootView) {
       this.buildStructure();
     }
@@ -197,7 +208,7 @@
     OB.TestRegistry.register('org.openbravo.client.application.View_' + this.tabId, this);
     OB.TestRegistry.register('org.openbravo.client.application.ViewGrid_' + this.tabId, this.viewGrid);
     OB.TestRegistry.register('org.openbravo.client.application.ViewForm_' + this.tabId, this.viewForm);
- 
+
     if (this.actionToolbarButtons) {
       length = this.actionToolbarButtons.length;
       for (i = 0; i < length; i++) {
@@ -206,7 +217,7 @@
         rightMemberButtons.push(actionButton);
       }
     }
-    
+
     // Look for specific toolbar buttons for this tab
     if (this.iconToolbarButtons) {
       length = this.iconToolbarButtons.length;
@@ -215,7 +226,7 @@
         OB.ToolbarRegistry.registerButton(this.tabId + '_' + i, isc.OBToolbarIconButton, this.iconToolbarButtons[i], 200 + (i * 10), this.tabId);
       }
     }
-    
+
     this.toolBar = isc.OBToolbar.create({
       view: this,
       visibility: 'hidden',
@@ -224,24 +235,24 @@
     });
 
     this.Super('initWidget', arguments);
-    
+
     this.toolBar.updateButtonState(true);
   },
-  
-  show: function() {
+
+  show: function () {
     this.Super('show', arguments);
   },
-  
-  destroy: function() {
+
+  destroy: function () {
     // destroy the datasource
     if (this.dataSource) {
       this.dataSource.destroy();
-      this.dataSource = null;      
+      this.dataSource = null;
     }
     return this.Super('destroy', arguments);
   },
-  
-  buildStructure: function(){
+
+  buildStructure: function () {
     var length, i, fld;
     this.createMainParts();
     this.createViewStructure();
@@ -250,7 +261,7 @@
       this.activeGridFormMessageLayout.setHeight('100%');
     }
     this.dataSource.view = this;
-    
+
     // directTabInfo is set when we are in direct link mode, i.e. directly opening
     // a specific tab with a record, the direct link logic will already take care
     // of fetching data
@@ -258,49 +269,53 @@
       this.viewGrid.fetchData(this.viewGrid.getCriteria());
       this.refreshContents = false;
     }
-    
+
     if (this.viewForm) {
       // setDataSource executes setFields which replaces the current fields
       // We don't want to destroy the associated DataSource objects
       this.viewForm.destroyItemObjects = false;
-      
+
       // is used to keep track of the original simple objects
       // used to create fields
       this.viewForm._originalFields = isc.clone(this.formFields);
       this.viewForm.fields = this.formFields;
       this.viewForm.firstFocusedField = this.firstFocusedField;
-      
+
       this.viewForm.setDataSource(this.dataSource, this.formFields);
       this.viewForm.isViewForm = true;
       this.viewForm.destroyItemObjects = true;
     }
-    
+
     if (this.isRootView) {
       if (this.childTabSet) {
         this.childTabSet.setState(isc.OBStandardView.STATE_IN_MID);
-        this.childTabSet.selectTab(this.childTabSet.tabs[0]);        
+        this.childTabSet.selectTab(this.childTabSet.tabs[0]);
         OB.TestRegistry.register('org.openbravo.client.application.ChildTabSet_' + this.tabId, this.viewForm);
       }
     }
-    
+
     if (this.defaultEditMode) {
       // prevent the grid from showing very shortly, so hide it right away
       this.viewGrid.hide();
     }
 
   },
-    
+
   // handles different ways by which an error can be passed from the 
   // system, translates this to an object with a type, title and message
-  setErrorMessageFromResponse: function(resp, data, req){
+  setErrorMessageFromResponse: function (resp, data, req) {
     var errorCode, index1, index2;
-    
+
     // only handle it once
     if (resp._errorMessageHandled) {
       return true;
     }
-    var msg = '', title = null, type = isc.OBMessageBar.TYPE_ERROR, isLabel = false, params = null;
-    var gridEditing = req.clientContext && (req.clientContext.editRow || req.clientContext.editRow === 0);  
+    var msg = '',
+        title = null,
+        type = isc.OBMessageBar.TYPE_ERROR,
+        isLabel = false,
+        params = null;
+    var gridEditing = req.clientContext && (req.clientContext.editRow || req.clientContext.editRow === 0);
     if (isc.isA.String(data)) {
       msg = data;
     } else if (data && data.response) {
@@ -340,7 +355,7 @@
       // hope that someone else will handle it
       return false;
     }
-    
+
     req.willHandleError = true;
     resp._errorMessageHandled = true;
     if (msg.indexOf('@') !== -1) {
@@ -367,24 +382,23 @@
     }
     return true;
   },
-  
-  setLabelInRow: function(rowNum, label, params) {
+
+  setLabelInRow: function (rowNum, label, params) {
     var me = this;
     OB.I18N.getLabel(label, params, {
-      setLabel: function(text){
+      setLabel: function (text) {
         me.viewGrid.setRecordErrorMessage(rowNum, text);
       }
     }, 'setLabel');
   },
-  
+
   // ** {{{ createViewStructure }}} **
   // Is to be overridden, is called in initWidget.
-  createViewStructure: function(){
-  },
-  
+  createViewStructure: function () {},
+
   // ** {{{ createMainParts }}} **
   // Creates the main layout components of this view.
-  createMainParts: function(){
+  createMainParts: function () {
     var me = this;
     if (this.tabId && this.tabId.length > 0) {
       this.formGridLayout = isc.HLayout.create({
@@ -394,17 +408,18 @@
         overflow: 'visible',
         view: this
       });
-      
+
       this.activeBar = isc.HLayout.create({
         height: '100%',
-        canFocus: true, // to set active view when it gets clicked
+        canFocus: true,
+        // to set active view when it gets clicked
         contents: '&nbsp;',
         width: OB.Styles.ActiveBar.width,
         styleName: OB.Styles.ActiveBar.inActiveStyleName,
         activeStyleName: OB.Styles.ActiveBar.activeStyleName,
         inActiveStyleName: OB.Styles.ActiveBar.inActiveStyleName,
-        
-        setActive: function(active){
+
+        setActive: function (active) {
           if (active) {
             this.setStyleName(this.activeStyleName);
           } else {
@@ -412,27 +427,27 @@
           }
         }
       });
-      
+
       this.viewGrid.setDataSource(this.dataSource, this.viewGrid.completeFields || this.viewGrid.fields);
-      
+
       if (this.viewGrid) {
         this.viewGrid.setWidth('100%');
         this.viewGrid.setView(this);
         this.formGridLayout.addMember(this.viewGrid);
       }
-      
+
       if (this.viewForm) {
         this.viewForm.setWidth('100%');
         this.formGridLayout.addMember(this.viewForm);
         this.viewForm.view = this;
-        
+
         this.viewGrid.addFormProperties(this.viewForm.obFormProperties);
       }
-      
+
       this.statusBar = isc.OBStatusBar.create({
         view: this.viewForm.view
       });
-      
+
       // NOTE: when changing the layout structure and the scrollbar
       // location for these layouts check if the scrollTo method 
       // in ob-view-form-linked-items is still called on the correct
@@ -444,16 +459,16 @@
         visibility: 'hidden',
         overflow: 'hidden'
       });
-      
+
       // to make sure that the form gets the correct scrollbars
       this.formContainerLayout = isc.OBFormContainerLayout.create({});
       this.formContainerLayout.addMember(this.viewForm);
-      
+
       this.statusBarFormLayout.addMember(this.statusBar);
       this.statusBarFormLayout.addMember(this.formContainerLayout);
-      
+
       this.formGridLayout.addMember(this.statusBarFormLayout);
-      
+
       // wrap the messagebar and the formgridlayout in a VLayout
       this.gridFormMessageLayout = isc.VLayout.create({
         canFocus: true,
@@ -463,7 +478,7 @@
       });
       this.gridFormMessageLayout.addMember(this.messageBar);
       this.gridFormMessageLayout.addMember(this.formGridLayout);
-      
+
       // and place the active bar to the left of the form/grid/messagebar
       this.activeGridFormMessageLayout = isc.HLayout.create({
         canFocus: true,
@@ -471,10 +486,10 @@
         width: '100%',
         overflow: 'hidden'
       });
-      
+
       this.activeGridFormMessageLayout.addMember(this.activeBar);
       this.activeGridFormMessageLayout.addMember(this.gridFormMessageLayout);
-      
+
       this.addMember(this.activeGridFormMessageLayout);
     }
     if (this.hasChildTabs) {
@@ -490,9 +505,10 @@
       this.statusBar.maximizeButton.disable();
     }
   },
-  
-  getDirectLinkUrl: function() {
-    var url = window.location.href, crit;
+
+  getDirectLinkUrl: function () {
+    var url = window.location.href,
+        crit;
     var qIndex = url.indexOf('?');
     var dIndex = url.indexOf('#');
     var index = -1;
@@ -510,101 +526,111 @@
     if (index !== -1) {
       url = url.substring(0, index);
     }
-    
+
     url = url + '?tabId=' + this.tabId;
-    if (this.isShowingForm && this.viewForm.isNew && this.isRootView) {      
-        url = url + '&command=NEW';      
+    if (this.isShowingForm && this.viewForm.isNew && this.isRootView) {
+      url = url + '&command=NEW';
     } else if ((this.isShowingForm || !this.isRootView) && this.viewGrid.getSelectedRecords() && this.viewGrid.getSelectedRecords().length === 1) {
       url = url + '&recordId=' + this.viewGrid.getSelectedRecord().id;
     } else if (!this.isShowingForm && this.isRootView) {
       crit = this.viewGrid.getCriteria();
       if (crit && crit.criteria && crit.criteria.length > 0) {
-        url = url + '&criteria=' + escape(isc.JSON.encode(crit, {prettyPrint: false, dateFormat: 'dateConstructor'}));
+        url = url + '&criteria=' + escape(isc.JSON.encode(crit, {
+          prettyPrint: false,
+          dateFormat: 'dateConstructor'
+        }));
       }
     }
-    
+
     return url;
   },
-  
+
   // ** {{{ addChildView }}} **
   // The addChildView creates the child tab and sets the pointer back to
   // this
   // parent.
-  addChildView: function(childView){
+  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')){
+
+    if ((childView.isTrlTab && OB.PropertyStore.get('ShowTrl', this.windowId) !== 'Y') || (childView.isAcctTab && OB.PropertyStore.get('ShowAcct', this.windowId) !== 'Y')) {
       return;
     }
-    
+
     this.standardWindow.addView(childView);
-    
+
     // Add buttons in parent to child. Note that currently it is only added one level.
-    if (this.actionToolbarButtons && this.actionToolbarButtons.length>0 && childView.showParentButtons){
+    if (this.actionToolbarButtons && this.actionToolbarButtons.length > 0 && childView.showParentButtons) {
       length = this.actionToolbarButtons.length;
       for (i = 0; i < length; i++) {
-        actionButton = isc.OBToolbarActionButton.create(isc.addProperties({}, this.actionToolbarButtons[i], {baseStyle: 'OBToolbarTextButtonParent'}));
+        actionButton = isc.OBToolbarActionButton.create(isc.addProperties({}, this.actionToolbarButtons[i], {
+          baseStyle: 'OBToolbarTextButtonParent'
+        }));
         actionButton.contextView = this; // Context is still parent view
         actionButton.toolBar = childView.toolBar;
         actionButton.view = childView;
-        
+
         childView.toolBar.rightMembers.push(actionButton);
-        
-        childView.toolBar.addMems([[actionButton]]);
-        childView.toolBar.addMems([[isc.HLayout.create({
-          width: (this.toolBar && this.toolBar.rightMembersMargin) || 12, 
-          height: 1
-        })]]);
+
+        childView.toolBar.addMems([
+          [actionButton]
+        ]);
+        childView.toolBar.addMems([
+          [isc.HLayout.create({
+            width: (this.toolBar && this.toolBar.rightMembersMargin) || 12,
+            height: 1
+          })]
+        ]);
       }
-      
+
       if (this.actionToolbarButtons.length > 0) {
         // Add margin in the right
-        childView.toolBar.addMems([[isc.HLayout.create({
-          width: (this.toolBar && this.toolBar.rightMargin) || 4, 
-          height: 1
-        })]]);
+        childView.toolBar.addMems([
+          [isc.HLayout.create({
+            width: (this.toolBar && this.toolBar.rightMargin) || 4,
+            height: 1
+          })]
+        ]);
       }
-    }    
- 
+    }
+
     childView.parentView = this;
     childView.parentTabSet = this.childTabSet;
-    
+
     // build the structure of the children
     childView.buildStructure();
-    
+
     var childTabDef = {
       title: childView.tabTitle,
       pane: childView
     };
-    
+
     this.childTabSet.addTab(childTabDef);
-    
+
     childView.tab = this.childTabSet.getTab(this.childTabSet.tabs.length - 1);
     // start inactive
     childView.tab.setCustomState(isc.OBStandardView.MODE_INACTIVE);
-    
-    OB.TestRegistry.register('org.openbravo.client.application.ChildTab_' + this.tabId + '_' + childView.tabId, childView.tab);    
+
+    OB.TestRegistry.register('org.openbravo.client.application.ChildTab_' + this.tabId + '_' + childView.tabId, childView.tab);
   },
-  
-  setReadOnly: function(readOnly){
+
+  setReadOnly: function (readOnly) {
     this.readOnly = readOnly;
     this.viewForm.readOnly = readOnly;
   },
-  
-  setSingleRecord: function(singleRecord){
+
+  setSingleRecord: function (singleRecord) {
     this.singleRecord = singleRecord;
   },
-  
-  setViewFocus: function(){
-    
+
+  setViewFocus: function () {
+
     var object, functionName, items, item, i;
-    
+
     // clear for a non-focusable item
     if (this.lastFocusedItem && !this.lastFocusedItem.getCanFocus()) {
       this.lastFocusedItem = null;
     }
-    
+
     if (this.isShowingForm && this.viewForm && this.viewForm.getFocusItem()) {
       object = this.viewForm.getFocusItem();
       functionName = 'focusInItem';
@@ -621,13 +647,13 @@
       object = this.viewGrid;
       functionName = 'focus';
     }
-    
+
     if (object && functionName) {
       isc.Page.setEvent(isc.EH.IDLE, object, isc.Page.FIRE_ONCE, functionName);
     }
   },
-  
-  setTabButtonState: function(active){
+
+  setTabButtonState: function (active) {
     var tabButton;
     if (this.tab) {
       tabButton = this.tab;
@@ -645,39 +671,39 @@
       tabButton.setCustomState(isc.OBStandardView.MODE_INACTIVE);
     }
   },
-  
-  hasValidState: function() {
+
+  hasValidState: function () {
     return this.isRootView || this.getParentId();
   },
-  
-  isActiveView: function() {
+
+  isActiveView: function () {
     if (this.standardWindow && this.standardWindow.activeView) {
       return this.standardWindow.activeView === this;
     } else {
       return false;
     }
   },
-    
-  setAsActiveView: function(autoSaveDone){
+
+  setAsActiveView: function (autoSaveDone) {
     if (!autoSaveDone && this.standardWindow.activeView && this.standardWindow.activeView !== this) {
       var actionObject = {
-          target: this,
-          method: this.setAsActiveView,
-          parameters: [true]
-        };
+        target: this,
+        method: this.setAsActiveView,
+        parameters: [true]
+      };
       this.standardWindow.doActionAfterAutoSave(actionObject, false);
       return;
     }
     this.standardWindow.setActiveView(this);
   },
-  
-  setTargetRecordInWindow: function(recordId) {
+
+  setTargetRecordInWindow: function (recordId) {
     if (this.isActiveView()) {
       this.standardWindow.setTargetInformation(this.tabId, recordId);
     }
   },
-  
-  setRecentDocument: function(record) {
+
+  setRecentDocument: function (record) {
     var params = this.standardWindow.getBookMarkParams();
     params.targetTabId = this.tabId;
     params.targetRecordId = record.id;
@@ -685,8 +711,8 @@
     params.recentTitle = record[OB.Constants.IDENTIFIER];
     OB.Layout.ViewManager.addRecentDocument(params);
   },
-  
-  setActiveViewProps: function(state){
+
+  setActiveViewProps: function (state) {
     if (state) {
       this.toolBar.show();
       this.statusBar.setActive(true);
@@ -695,14 +721,14 @@
       this.viewGrid.setActive(true);
       this.viewGrid.markForRedraw();
       // if we are in form view
-      if (this.isShowingForm && !this.viewForm.isNew) {        
+      if (this.isShowingForm && !this.viewForm.isNew) {
         this.setTargetRecordInWindow(this.viewGrid.getSelectedRecord().id);
       }
     } else {
-      
+
       // close any editors we may have
       this.viewGrid.closeAnyOpenEditor();
-      
+
       this.toolBar.hide();
       this.statusBar.setActive(false);
       this.activeBar.setActive(false);
@@ -720,15 +746,15 @@
     }
     this.setTabButtonState(state);
   },
-  
-  visibilityChanged: function(visible){
+
+  visibilityChanged: function (visible) {
     if (visible && this.refreshContents) {
       this.doRefreshContents(true);
     }
   },
-    
-  doRefreshContents: function(doRefreshWhenVisible, forceRefresh){
-    
+
+  doRefreshContents: function (doRefreshWhenVisible, forceRefresh) {
+
     // if not visible anymore, reset the view back
     if (!this.isViewVisible()) {
       if (this.isShowingForm) {
@@ -739,51 +765,51 @@
     }
 
     // update this one at least before bailing out
-    this.updateTabTitle();    
-    
+    this.updateTabTitle();
+
     if (!this.isViewVisible() && !forceRefresh) {
       this.refreshContents = doRefreshWhenVisible;
       return;
     }
-    
+
     if (!this.refreshContents && !doRefreshWhenVisible && !forceRefresh) {
       return;
     }
-    
+
     // can be used by others to see that we are refreshing content
     this.refreshContents = true;
-    
+
     // clear all our selections..
     // note the true parameter prevents autosave actions from happening
     // this should have been done before anyway
     this.viewGrid.deselectAllRecords(false, true);
-    
+
     if (this.viewGrid.filterEditor) {
       this.viewGrid.clearFilter(false, true);
     }
     if (this.viewGrid.data && this.viewGrid.data.setCriteria) {
       this.viewGrid.data.setCriteria(null);
     }
-    
+
     // hide the messagebar
     this.messageBar.hide();
 
     // allow default edit mode again
     this.allowDefaultEditMode = true;
-    
+
     if (this.viewForm && this.isShowingForm) {
       this.viewForm.resetForm();
     }
-        
+
     if (this.shouldOpenDefaultEditMode()) {
       this.openDefaultEditView();
     } else if (this.isShowingForm && !(this.allowDefaultEditMode && this.defaultEditMode)) {
       this.switchFormGridVisibility();
     }
-    
+
     this.viewGrid.refreshContents();
 
-    this.toolBar.updateButtonState(true);    
+    this.toolBar.updateButtonState(true);
 
     // if not visible or the parent also needs to be refreshed
     // enable the following code if we don't automatically select the first
@@ -794,9 +820,9 @@
     this.refreshContents = false;
   },
 
-  refreshChildViews: function() {
+  refreshChildViews: function () {
     var i, length, tabViewPane;
-    
+
     if (this.childTabSet) {
       length = this.childTabSet.tabs.length;
       for (i = 0; i < length; i++) {
@@ -807,28 +833,27 @@
       }
     }
   },
-  
-  shouldOpenDefaultEditMode: function(){
+
+  shouldOpenDefaultEditMode: function () {
     // can open default edit mode if defaultEditMode is set
     // and this is the root view or a child view with a selected parent.
-    var oneOrMoreSelected = this.viewGrid.data && this.viewGrid.data.lengthIsKnown && this.viewGrid.data.lengthIsKnown() &&
-    this.viewGrid.data.getLength() >= 1;
+    var oneOrMoreSelected = this.viewGrid.data && this.viewGrid.data.lengthIsKnown && this.viewGrid.data.lengthIsKnown() && this.viewGrid.data.getLength() >= 1;
     return this.allowDefaultEditMode && oneOrMoreSelected && this.defaultEditMode && (this.isRootView || this.parentView.viewGrid.getSelectedRecords().length === 1);
   },
-  
+
   // opendefaultedit view for a child view is only called
   // when a new parent is selected, in that case the 
   // edit view should be opened without setting the focus in the form
-  openDefaultEditView: function(record){
+  openDefaultEditView: function (record) {
     if (!this.shouldOpenDefaultEditMode()) {
       return;
     }
     // preventFocus is treated as a boolean later
     var preventFocus = !this.isRootView;
-    
+
     // don't open it again
     this.allowDefaultEditMode = false;
-    
+
     // open form in edit mode
     if (record) {
       this.editRecord(record, preventFocus);
@@ -838,10 +863,10 @@
     }
     // in other cases just show grid
   },
-  
+
   // ** {{{ switchFormGridVisibility }}} **
   // Switch from form to grid view or the other way around
-  switchFormGridVisibility: function(){
+  switchFormGridVisibility: function () {
     if (!this.isShowingForm) {
       this.viewGrid.hide();
       this.statusBarFormLayout.show();
@@ -864,13 +889,13 @@
           this.viewGrid.focusInFirstFilterEditor();
         }
       }
-      
+
       this.viewGrid.setHeight('100%');
     }
     this.updateTabTitle();
   },
-  
-  doHandleClick: function(){
+
+  doHandleClick: function () {
     if (!this.childTabSet) {
       return;
     }
@@ -880,8 +905,8 @@
       this.state = isc.OBStandardView.STATE_MID;
     }
   },
-  
-  doHandleDoubleClick: function(){
+
+  doHandleDoubleClick: function () {
     var tempState;
     if (!this.childTabSet) {
       return;
@@ -901,42 +926,42 @@
     }
     this.previousState = tempState;
   },
-  
+
   // ** {{{ editNewRecordGrid }}} **
   // Opens the inline grid editing for a new record.
-  editNewRecordGrid: function(rowNum) {
+  editNewRecordGrid: function (rowNum) {
     if (this.isShowingForm) {
-      this.switchFormGridVisibility();      
+      this.switchFormGridVisibility();
     }
     this.viewGrid.startEditingNew(rowNum);
   },
-  
+
   // ** {{{ editRecord }}} **
   // Opens the edit form and selects the record in the grid, will refresh
   // child views also
-  editRecord: function(record, preventFocus, focusFieldName){
+  editRecord: function (record, preventFocus, focusFieldName) {
 
     this.messageBar.hide();
-    
+
     if (!this.isShowingForm) {
       this.switchFormGridVisibility();
     }
-    
+
     if (!record) { //  new case
       this.viewGrid.deselectAllRecords();
       this.refreshChildViews();
       this.viewForm.editNewRecord(preventFocus);
     } else {
       this.viewGrid.doSelectSingleRecord(record);
-      
+
       // also handle the case that there are unsaved values in the grid
       // show them in the form
       var rowNum = this.viewGrid.getRecordIndex(record);
       this.viewForm.editRecord(this.viewGrid.getEditedRecord(rowNum), preventFocus, this.viewGrid.recordHasChanges(rowNum), focusFieldName);
     }
   },
-  
-  setMaximizeRestoreButtonState: function(){
+
+  setMaximizeRestoreButtonState: function () {
     // single view, no maximize or restore
     if (!this.hasChildTabs && this.isRootView) {
       return;
@@ -946,7 +971,7 @@
     if (this.parentTabSet) {
       theState = this.parentTabSet.state;
     }
-    
+
     if (theState === isc.OBStandardView.STATE_TOP_MAX) {
       this.statusBar.maximizeButton.hide();
       this.statusBar.restoreButton.show(true);
@@ -961,8 +986,8 @@
       this.statusBar.restoreButton.hide();
     }
   },
-  
-  maximize: function(){
+
+  maximize: function () {
     if (this.parentTabSet) {
       this.parentTabSet.doHandleDoubleClick();
     } else {
@@ -970,8 +995,8 @@
     }
     this.setMaximizeRestoreButtonState();
   },
-  
-  restore: function(){
+
+  restore: function () {
     if (this.parentTabSet) {
       this.parentTabSet.doHandleDoubleClick();
     } else {
@@ -979,9 +1004,9 @@
     }
     this.setMaximizeRestoreButtonState();
   },
-  
+
   // go to a next or previous record, if !next then the previous one is used
-  editNextPreviousRecord: function(next){
+  editNextPreviousRecord: function (next) {
     var rowNum, newRowNum, newRecord, currentSelectedRecord = this.viewGrid.getSelectedRecord();
     if (!currentSelectedRecord) {
       return;
@@ -999,11 +1024,11 @@
     this.viewGrid.scrollRecordToTop(newRowNum);
     this.editRecord(newRecord);
   },
-  
-  openDirectTabView: function(showContent) {
+
+  openDirectTabView: function (showContent) {
     // our content is done through the direct mode stuff
     this.refreshContents = false;
-    
+
     if (this.parentTabSet && this.parentTabSet.getSelectedTab() !== this.tab) {
       this.parentTabSet.selectTab(this.tab);
     }
@@ -1016,7 +1041,7 @@
         this.doHandleClick();
       }
       this.setMaximizeRestoreButtonState();
-      
+
       // show the form with the selected record
       // if there is one, otherwise we are in grid mode
       if (this.viewGrid.targetRecordId && !this.isShowingForm) {
@@ -1031,43 +1056,44 @@
 
     if (this.parentView) {
       this.parentView.openDirectTabView(false);
-    } 
+    }
   },
-  
+
   // ** {{{ recordSelected }}} **
   // Is called when a record get's selected. Will refresh direct child views
   // which will again refresh their children.
-  recordSelected: function(){
+  recordSelected: function () {
     // no change go away
     if (!this.hasSelectionStateChanged()) {
       return;
     }
-    var me = this, callback = function () {
-      me.delayedRecordSelected();
-    };
+    var me = this,
+        callback = function () {
+        me.delayedRecordSelected();
+        };
     // wait 2 times longer than the fire on pause delay default
     this.fireOnPause('delayedRecordSelected_' + this.ID, callback, this.fireOnPauseDelay * 2);
   },
-  
+
   // function is called with a small delay to handle the case that a user
   // navigates quickly over a grid
-  delayedRecordSelected: function() {
+  delayedRecordSelected: function () {
     var length;
-    
+
     // is actually a different parent selected, only then refresh children
-    var differentRecordId = !this.lastRecordSelected || !this.viewGrid.getSelectedRecord() ||
-      this.viewGrid.getSelectedRecord().id !== this.lastRecordSelected.id;
+    var differentRecordId = !this.lastRecordSelected || !this.viewGrid.getSelectedRecord() || this.viewGrid.getSelectedRecord().id !== this.lastRecordSelected.id;
     var selectedRecordId = this.viewGrid.getSelectedRecord() ? this.viewGrid.getSelectedRecord().id : null;
-    
+
     this.updateLastSelectedState();
-    this.updateTabTitle();    
-    
+    this.updateTabTitle();
+
     // commented line because of https://issues.openbravo.com/view.php?id=18963
     // toolbar seems to be refreshed in any case
     // note only set session info if there is a record selected
     this.toolBar.updateButtonState(!selectedRecordId || this.isEditingGrid || this.isShowingForm);
 
-    var tabViewPane = null, i;
+    var tabViewPane = null,
+        i;
 
     // refresh the tabs
     if (this.childTabSet && (differentRecordId || !this.isOpenDirectModeParent)) {
@@ -1076,7 +1102,7 @@
         tabViewPane = this.childTabSet.tabs[i].pane;
 
         if (!selectedRecordId || !this.isOpenDirectModeParent || selectedRecordId !== tabViewPane.parentRecordId) {
-          tabViewPane.doRefreshContents(true); 
+          tabViewPane.doRefreshContents(true);
         }
       }
     }
@@ -1084,38 +1110,36 @@
   },
 
   // set childs to refresh when they are made visible
-  setChildsToRefresh: function() {
+  setChildsToRefresh: function () {
     var length, i;
-    
+
     if (this.childTabSet) {
       length = this.childTabSet.tabs.length;
       for (i = 0; i < length; i++) {
         if (!this.childTabSet.tabs[i].pane.isVisible()) {
-          this.childTabSet.tabs[i].pane.refreshContents = true;  
+          this.childTabSet.tabs[i].pane.refreshContents = true;
         }
       }
     }
   },
-  
-  hasSelectionStateChanged: function() {
-    return ((this.viewGrid.getSelectedRecords() && this.viewGrid.getSelectedRecords().length !== this.lastRecordSelectedCount) || 
-        (this.viewGrid.getSelectedRecord() && this.viewGrid.getSelectedRecord().id !== this.lastRecordSelected.id)) || 
-      (this.lastRecordSelected && !this.viewGrid.getSelectedRecord());
+
+  hasSelectionStateChanged: function () {
+    return ((this.viewGrid.getSelectedRecords() && this.viewGrid.getSelectedRecords().length !== this.lastRecordSelectedCount) || (this.viewGrid.getSelectedRecord() && this.viewGrid.getSelectedRecord().id !== this.lastRecordSelected.id)) || (this.lastRecordSelected && !this.viewGrid.getSelectedRecord());
   },
 
-  updateLastSelectedState: function() {
+  updateLastSelectedState: function () {
     this.lastRecordSelectedCount = this.viewGrid.getSelectedRecords().length;
-    this.lastRecordSelected = this.viewGrid.getSelectedRecord(); 
+    this.lastRecordSelected = this.viewGrid.getSelectedRecord();
   },
 
-  getParentId: function(){
+  getParentId: function () {
     var parentRecord = this.getParentRecord();
     if (parentRecord) {
       return parentRecord.id;
     }
   },
 
-  getParentRecord: function(){
+  getParentRecord: function () {
     if (!this.parentView || !this.parentView.viewGrid.getSelectedRecords() || this.parentView.viewGrid.getSelectedRecords().length !== 1) {
       return null;
     }
@@ -1127,25 +1151,24 @@
 
     return this.parentView.viewGrid.getSelectedRecord();
   },
-  
-  updateTabTitle: function(){
-    var prefix = '', postFix;
+
+  updateTabTitle: function () {
+    var prefix = '',
+        postFix;
     var suffix = '';
     var hasChanged = this.isShowingForm && (this.viewForm.isNew || this.viewForm.hasChanged);
-    hasChanged = hasChanged || (this.isEditingGrid && (this.viewGrid.hasErrors() || this.viewGrid.getEditForm().isNew || this.viewGrid.getEditForm().hasChanged)); 
+    hasChanged = hasChanged || (this.isEditingGrid && (this.viewGrid.hasErrors() || this.viewGrid.getEditForm().isNew || this.viewGrid.getEditForm().hasChanged));
     if (hasChanged) {
       prefix = '* ';
-    }/* else {  // To avoid tab width grow each time the * is shown
-      prefix = '<span style="color: transparent">*</span> ';
-    }*/
-    
+    }
+
     // store the original tab title
     if (!this.originalTabTitle) {
       this.originalTabTitle = this.tabTitle;
     }
-    
+
     var identifier, tab, tabSet, title;
-    
+
     if (this.viewGrid.getSelectedRecord()) {
       identifier = this.viewGrid.getSelectedRecord()[OB.Constants.IDENTIFIER];
       if (this.viewGrid.getSelectedRecord()._new) {
@@ -1157,10 +1180,10 @@
         identifier = ' - ' + identifier;
       }
     }
-    
+
     // showing the form
     if (this.isShowingForm && this.viewGrid.getSelectedRecord() && this.viewGrid.getSelectedRecord()[OB.Constants.IDENTIFIER]) {
-      
+
       if (!this.parentTabSet && this.viewTabId) {
         tab = OB.MainView.TabSet.getTab(this.viewTabId);
         tabSet = OB.MainView.TabSet;
@@ -1196,8 +1219,7 @@
       tab = this.tab;
       tabSet = this.parentTabSet;
 
-      if (!this.parentView.viewGrid.getSelectedRecords() || 
-          this.parentView.viewGrid.getSelectedRecords().length !== 1) {
+      if (!this.parentView.viewGrid.getSelectedRecords() || this.parentView.viewGrid.getSelectedRecords().length !== 1) {
         title = this.originalTabTitle;
       } else if (this.recordCount) {
         title = this.originalTabTitle + ' (' + this.recordCount + ')';
@@ -1205,82 +1227,81 @@
         title = this.originalTabTitle;
       }
     }
-    
+
     // happens when a tab gets closed
     if (!tab) {
       return;
     }
-    
+
     if (title) {
-      
+
       // show a prompt with the title info
       tab.prompt = title;
       tab.showPrompt = true;
       tab.hoverWidth = 150;
-      
+
       // trunc the title if it too large 
       title = OB.Utilities.truncTitle(title);
-      
+
       // add the prefix/suffix here to prevent cutoff on that
       title = prefix + title + suffix;
       tabSet.setTabTitle(tab, title);
     }
-    
+
     // added check on tab as initially it is not set
     if (this.isRootView && tab) {
       // update the document title
       document.title = 'Openbravo - ' + tab.title;
     }
   },
-    
-  isViewVisible: function(){
+
+  isViewVisible: function () {
     // this prevents data requests for minimized tabs
     // note this.tab.isVisible is done as the tab is visible earlier than
     // the pane
     var visible = this.tab && this.tab.isDrawn() && this.tab.pane.isDrawn() && this.tab.pane.isVisible();
-    return visible  && (!this.parentTabSet || this.parentTabSet.getSelectedTabNumber() ===
-            this.parentTabSet.getTabNumber(this.tab));
+    return visible && (!this.parentTabSet || this.parentTabSet.getSelectedTabNumber() === this.parentTabSet.getTabNumber(this.tab));
   },
-  
+
   // ++++++++++++++++++++ Button Actions ++++++++++++++++++++++++++
-  
   // make a special refresh:
   // - refresh the current selected record without changing the selection
   // - refresh the parent/grand-parent in the same way without changing the selection
   // - recursive to children: refresh the children, put the children in grid mode and refresh
-  
-  refresh: function(refreshCallback, autoSaveDone){
+  refresh: function (refreshCallback, autoSaveDone) {
+    var me = this,
+        view = this,
+        actionObject, formRefresh, callback;
+
     // first save what we have edited
     if (!autoSaveDone) {
-      var actionObject = {
-          target: this,
-          method: this.refresh,
-          parameters: [refreshCallback, true]
-        };
+      actionObject = {
+        target: this,
+        method: this.refresh,
+        parameters: [refreshCallback, true]
+      };
       this.standardWindow.doActionAfterAutoSave(actionObject, false);
       return;
     }
 
-    if(this.viewForm && this.viewForm.contextInfo) {
+    if (this.viewForm && this.viewForm.contextInfo) {
       this.viewForm.contextInfo = null;
     }
 
-    var me = this;
-    var formRefresh = function() {
+    formRefresh = function () {
       if (refreshCallback) {
         refreshCallback();
       }
       me.viewForm.refresh();
     };
-    
+
     if (!this.isShowingForm) {
       this.viewGrid.refreshGrid(refreshCallback);
     } else {
-      var view = this;
       if (this.viewForm.hasChanged) {
-        var callback = function(ok){
+        callback = function (ok) {
           if (ok) {
-            view.viewGrid.refreshGrid(formRefresh);            
+            view.viewGrid.refreshGrid(formRefresh);
           }
         };
         isc.ask(OB.I18N.getLabel('OBUIAPP_ConfirmRefresh'), callback);
@@ -1289,24 +1310,29 @@
       }
     }
   },
-  
-  refreshParentRecord: function(callBackFunction) {
+
+  refreshParentRecord: function (callBackFunction) {
     if (this.parentView) {
       this.parentView.refreshCurrentRecord(callBackFunction);
     }
   },
-  
-  refreshCurrentRecord: function(callBackFunction) {
+
+  refreshCurrentRecord: function (callBackFunction) {
+    var me = this,
+        record, criteria, callback;
+
     if (!this.viewGrid.getSelectedRecord()) {
       return;
     }
-    var record = this.viewGrid.getSelectedRecord(), criteria;
-    
+
+    record = this.viewGrid.getSelectedRecord();
+
     criteria = {
-        operator: 'and', 
-        _constructor: "AdvancedCriteria", 
-        criteria:[]};
-        
+      operator: 'and',
+      _constructor: "AdvancedCriteria",
+      criteria: []
+    };
+
     // add a dummy criteria to force a fetch
     criteria.criteria.push(isc.OBRestDataSource.getDummyCriterion());
 
@@ -1316,11 +1342,10 @@
       operator: 'equals',
       value: record.id
     });
-    
-    var me = this;
-    var callback = function(resp, data, req) {
+
+    callback = function (resp, data, req) {
       // this line does not work, but it should:
-//      me.getDataSource().updateCaches(resp, req);
+      //      me.getDataSource().updateCaches(resp, req);
       // therefore do an explicit update of the visual components
       if (me.isShowingForm) {
         me.viewForm.refresh();
@@ -1332,14 +1357,14 @@
         me.viewGrid.refreshRow(recordIndex);
         me.viewGrid.redraw();
       }
-      
-      
+
+
       if (callBackFunction) {
         callBackFunction();
       }
     };
 
-    if(this.viewForm && this.viewForm.contextInfo) {
+    if (this.viewForm && this.viewForm.contextInfo) {
       this.viewForm.contextInfo = null;
     }
 
@@ -1347,11 +1372,14 @@
     this.refreshParentRecord(callBackFunction);
   },
 
-  hasNotChanged: function() {
-    var view = this, form = view.viewForm, length, selectedRecords,
-      grid = view.viewGrid, allRowsHaveErrors, hasErrors = false, editRow, i;
+  hasNotChanged: function () {
+    var view = this,
+        form = view.viewForm,
+        length, selectedRecords, grid = view.viewGrid,
+        allRowsHaveErrors, hasErrors = false,
+        editRow, i;
     if (view.isShowingForm) {
-      if(form.isNew) {
+      if (form.isNew) {
         return false;
       }
       return form.isSaving || form.readOnly || !view.hasValidState() || !form.hasChanged;
@@ -1372,28 +1400,32 @@
     }
   },
 
-  saveRow: function(){
+  saveRow: function () {
     if (this.isEditingGrid) {
       this.viewGrid.endEditing();
     } else {
       this.viewForm.saveRow();
     }
   },
- 
-  deleteSelectedRows: function(autoSaveDone){
+
+  deleteSelectedRows: function (autoSaveDone) {
+    var msg, dialogTitle, view = this,
+        deleteCount, callback;
+
     if (!this.readOnly) {
       // first save what we have edited
       if (!autoSaveDone) {
         var actionObject = {
-            target: this,
-            method: this.deleteSelectedRows,
-            parameters: [true]
-          };
+          target: this,
+          method: this.deleteSelectedRows,
+          parameters: [true]
+        };
         this.standardWindow.doActionAfterAutoSave(actionObject, false);
         return;
       }
-    
-      var msg, dialogTitle, view = this, deleteCount = this.viewGrid.getSelection().length;
+
+      deleteCount = this.viewGrid.getSelection().length;
+
       if (deleteCount === 1) {
         msg = OB.I18N.getLabel('OBUIAPP_DeleteConfirmationSingle');
         dialogTitle = OB.I18N.getLabel('OBUIAPP_DialogTitle_DeleteRecord');
@@ -1401,72 +1433,74 @@
         msg = OB.I18N.getLabel('OBUIAPP_DeleteConfirmationMultiple', [this.viewGrid.getSelection().length]);
         dialogTitle = OB.I18N.getLabel('OBUIAPP_DialogTitle_DeleteRecords');
       }
-    
-      var callback = function(ok){
-        var i, doUpdateTotalRows, data, deleteData, error, 
-          recordInfos = [], length,
-          removeCallBack = function(resp, data, req){
-            var length,
-              localData = resp.dataObject || resp.data || data, 
+
+      callback = function (ok) {
+        var i, doUpdateTotalRows, data, deleteData, error, recordInfos = [],
+            length, removeCallBack, selection;
+
+        removeCallBack = function (resp, data, req) {
+          var length, localData = resp.dataObject || resp.data || data,
               i, updateTotalRows;
-            
-            if (!localData) {
-              // bail out, an error occured which should be displayed to the user now
-              return;
+
+          if (!localData) {
+            // bail out, an error occured which should be displayed to the user now
+            return;
+          }
+          var status = resp.status;
+          if (localData && localData.hasOwnProperty('status')) {
+            status = localData.status;
+          }
+          if (localData && localData.response && localData.response.hasOwnProperty('status')) {
+            status = localData.response.status;
+          }
+          if (status === isc.RPCResponse.STATUS_SUCCESS) {
+            if (view.isShowingForm) {
+              view.switchFormGridVisibility();
             }
-            var status = resp.status;
-            if (localData && localData.hasOwnProperty('status')) {
-              status = localData.status;
-            }
-            if (localData && localData.response && localData.response.hasOwnProperty('status')) {
-              status = localData.response.status;
-            }
-            if (status === isc.RPCResponse.STATUS_SUCCESS) {
-              if (view.isShowingForm) {
-                view.switchFormGridVisibility();
+            view.messageBar.setMessage(isc.OBMessageBar.TYPE_SUCCESS, null, OB.I18N.getLabel('OBUIAPP_DeleteResult', [deleteCount]));
+            if (deleteData) {
+              // note totalrows is used when inserting a new row, to determine after which
+              // record to add a new row
+              updateTotalRows = (view.viewGrid.data.getLength() === view.viewGrid.data.totalRows);
+              // deleteData is computed below
+              length = deleteData.ids.length;
+              for (i = 0; i < length; i++) {
+                recordInfos.push({
+                  id: deleteData.ids[i]
+                });
               }
-              view.messageBar.setMessage(isc.OBMessageBar.TYPE_SUCCESS, null, OB.I18N.getLabel('OBUIAPP_DeleteResult', [deleteCount]));
-              if (deleteData) {
-                // note totalrows is used when inserting a new row, to determine after which
-                // record to add a new row
-                updateTotalRows = (view.viewGrid.data.getLength() === view.viewGrid.data.totalRows);
-                // deleteData is computed below
-                length = deleteData.ids.length;
-                for (i = 0 ; i < length; i++) {
-                  recordInfos.push({id: deleteData.ids[i]});
-                }
-                view.viewGrid.data.handleUpdate('remove', recordInfos, false, req);
-                if (updateTotalRows) {
-                  view.viewGrid.data.totalRows = view.viewGrid.data.getLength();
-                }
-              } else if (doUpdateTotalRows) {
+              view.viewGrid.data.handleUpdate('remove', recordInfos, false, req);
+              if (updateTotalRows) {
                 view.viewGrid.data.totalRows = view.viewGrid.data.getLength();
               }
-              view.viewGrid.updateRowCountDisplay();
-              view.refreshChildViews();
-              view.refreshParentRecord();
-            } else {
-              // get the error message from the dataObject 
-              if (localData.response && localData.response.error && localData.response.error.message) {
-                error = localData.response.error;
-                if (error.type && error.type === 'user') {
-                  view.messageBar.setLabel(isc.OBMessageBar.TYPE_ERROR, null, error.message, error.params);
-                } else if (error.message && error.params) {
-                    view.messageBar.setLabel(isc.OBMessageBar.TYPE_ERROR, null, error.message, error.params);
-                } else if (error.message) {
-                  view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, error.message);
-                } else {
-                  view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_DeleteResult', [0]));
-                }
+            } else if (doUpdateTotalRows) {
+              view.viewGrid.data.totalRows = view.viewGrid.data.getLength();
+            }
+            view.viewGrid.updateRowCountDisplay();
+            view.refreshChildViews();
+            view.refreshParentRecord();
+          } else {
+            // get the error message from the dataObject 
+            if (localData.response && localData.response.error && localData.response.error.message) {
+              error = localData.response.error;
+              if (error.type && error.type === 'user') {
+                view.messageBar.setLabel(isc.OBMessageBar.TYPE_ERROR, null, error.message, error.params);
+              } else if (error.message && error.params) {
+                view.messageBar.setLabel(isc.OBMessageBar.TYPE_ERROR, null, error.message, error.params);
+              } else if (error.message) {
+                view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, error.message);
+              } else {
+                view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_DeleteResult', [0]));
               }
             }
-          };
-      
+          }
+        };
+
         if (ok) {
-          var selection = view.viewGrid.getSelection().duplicate();
+          selection = view.viewGrid.getSelection().duplicate();
           // deselect the current records
           view.viewGrid.deselectAllRecords();
-          
+
           if (selection.length > 1) {
             deleteData = {};
             deleteData.entity = view.entity;
@@ -1483,24 +1517,28 @@
             // record to add a new row
             doUpdateTotalRows = (view.viewGrid.data.getLength() === view.viewGrid.data.totalRows);
             // note remove data expects only the id, the record key as the first param
-            view.viewGrid.removeData({id: selection[0].id}, removeCallBack, {});
+            view.viewGrid.removeData({
+              id: selection[0].id
+            }, removeCallBack, {});
           }
         }
       };
-      isc.ask(msg, callback, {title: dialogTitle});
+      isc.ask(msg, callback, {
+        title: dialogTitle
+      });
     }
   },
-  
-  newRow: function(rowNum) {
+
+  newRow: function (rowNum) {
     var actionObject = {
-        target: this,
-        method: this.editNewRecordGrid,
-        parameters: [rowNum]
-      };
+      target: this,
+      method: this.editNewRecordGrid,
+      parameters: [rowNum]
+    };
     this.standardWindow.doActionAfterAutoSave(actionObject, false);
   },
-  
-  newDocument: function(){
+
+  newDocument: function () {
     var actionObject = {
       target: this,
       method: this.editRecord,
@@ -1509,8 +1547,9 @@
     this.standardWindow.doActionAfterAutoSave(actionObject, false);
   },
 
-  undo: function(){
-    var view = this, callback, form, grid, errorRows, i, length;
+  undo: function () {
+    var view = this,
+        callback, form, grid, errorRows, i, length;
     view.messageBar.hide(true);
     if (this.isEditingGrid) {
       grid = view.viewGrid;
@@ -1521,7 +1560,7 @@
       if (grid.hasErrors()) {
         errorRows = grid.getErrorRows();
         length = errorRows.length;
-        for (i = 0; i < length; i++){
+        for (i = 0; i < length; i++) {
           grid.selectRecord(grid.getRecord(errorRows[i]));
         }
         grid.undoEditSelectedRows();
@@ -1539,10 +1578,9 @@
       grid.undoEditSelectedRows();
     }
   },
-  
+
   // ++++++++++++++++++++ Parent-Child Tab Handling ++++++++++++++++++++++++++
-  
-  convertToPercentageHeights: function(){
+  convertToPercentageHeights: function () {
     if (!this.members[1]) {
       return;
     }
@@ -1552,8 +1590,8 @@
     this.members[0].setHeight('*');
     this.members[1].setHeight(percentage + '%');
   },
-  
-  setTopMaximum: function(){
+
+  setTopMaximum: function () {
     this.setHeight('100%');
     if (this.members[1]) {
       this.members[1].setState(isc.OBStandardView.STATE_MIN);
@@ -1565,8 +1603,8 @@
     this.state = isc.OBStandardView.STATE_TOP_MAX;
     this.setMaximizeRestoreButtonState();
   },
-  
-  setBottomMaximum: function(){
+
+  setBottomMaximum: function () {
     if (this.members[1]) {
       this.members[0].hide();
       this.members[1].setHeight('100%');
@@ -1574,8 +1612,8 @@
     this.state = isc.OBStandardView.STATE_BOTTOM_MAX;
     this.setMaximizeRestoreButtonState();
   },
-  
-  setHalfSplit: function(){
+
+  setHalfSplit: function () {
     this.setHeight('100%');
     var i, tab, pane;
     if (this.members[1]) {
@@ -1598,8 +1636,8 @@
     this.state = isc.OBStandardView.STATE_MID;
     this.setMaximizeRestoreButtonState();
   },
-  
-  getCurrentValues: function(){
+
+  getCurrentValues: function () {
     var ret;
     if (this.isShowingForm) {
       ret = this.viewForm.getValues();
@@ -1613,9 +1651,10 @@
     // and the form view is switched for grid view
     return ret || {};
   },
-  
-  getPropertyFromColumnName: function(columnName){
-    var length = this.view.propertyToColumns.length, i;
+
+  getPropertyFromColumnName: function (columnName) {
+    var length = this.view.propertyToColumns.length,
+        i;
     for (i = 0; i < length; i++) {
       var propDef = this.view.propertyToColumns[i];
       if (propDef.dbColumn === columnName) {
@@ -1624,9 +1663,10 @@
     }
     return null;
   },
-  
-  getPropertyDefinitionFromDbColumnName: function(columnName){
-    var length = this.propertyToColumns.length, i;
+
+  getPropertyDefinitionFromDbColumnName: function (columnName) {
+    var length = this.propertyToColumns.length,
+        i;
     for (i = 0; i < length; i++) {
       var propDef = this.propertyToColumns[i];
       if (propDef.dbColumn === columnName) {
@@ -1635,9 +1675,10 @@
     }
     return null;
   },
-  
-  getPropertyFromDBColumnName: function(columnName){
-    var length = this.propertyToColumns.length, i;
+
+  getPropertyFromDBColumnName: function (columnName) {
+    var length = this.propertyToColumns.length,
+        i;
     for (i = 0; i < length; i++) {
       var propDef = this.propertyToColumns[i];
       if (propDef.dbColumn === columnName) {
@@ -1646,9 +1687,10 @@
     }
     return null;
   },
-  
-  getPropertyDefinitionFromInpColumnName: function(columnName){
-    var length = this.propertyToColumns.length, i;
+
+  getPropertyDefinitionFromInpColumnName: function (columnName) {
+    var length = this.propertyToColumns.length,
+        i;
     for (i = 0; i < length; i++) {
       var propDef = this.propertyToColumns[i];
       if (propDef.inpColumn === columnName) {
@@ -1659,13 +1701,12 @@
   },
 
   //++++++++++++++++++ Reading context ++++++++++++++++++++++++++++++
-  
-  getContextInfo: function(onlySessionProperties, classicMode, forceSettingContextVars, convertToClassicFormat){
-    var contextInfo = {}, addProperty, rowNum;
+  getContextInfo: function (onlySessionProperties, classicMode, forceSettingContextVars, convertToClassicFormat) {
+    var contextInfo = {},
+        addProperty, rowNum, properties, i, p;
     // if classicmode is undefined then both classic and new props are used
     var classicModeUndefined = (typeof classicMode === 'undefined');
-    var value, field, record, form, component, propertyObj, 
-      type, length;
+    var value, field, record, form, component, propertyObj, type, length;
 
     if (classicModeUndefined) {
       classicMode = true;
@@ -1693,15 +1734,15 @@
       record = this.viewGrid.getSelectedRecord();
       rowNum = this.viewGrid.getRecordIndex(record);
       if (rowNum || rowNum === 0) {
-        record = isc.addProperties({}, record, this.viewGrid.getEditValues(rowNum));    
+        record = isc.addProperties({}, record, this.viewGrid.getEditValues(rowNum));
       }
       component = this.viewGrid;
     }
-    
-    var properties = this.propertyToColumns, i, p;
-    
+
+    properties = this.propertyToColumns;
+
     if (record) {
-    
+
       // add the id of the record itself also if not set
       if (!record[OB.Constants.ID] && this.viewGrid.getSelectedRecord()) {
         // if in edit mode then the grid always has the current record selected
@@ -1740,10 +1781,10 @@
           }
         }
       }
-      
-      if (!onlySessionProperties){
-        for (p in this.standardProperties){
-          if (this.standardProperties.hasOwnProperty(p)){
+
+      if (!onlySessionProperties) {
+        for (p in this.standardProperties) {
+          if (this.standardProperties.hasOwnProperty(p)) {
             if (classicMode) {
               contextInfo[p] = this.convertContextValue(this.standardProperties[p]);
             } else {
@@ -1763,26 +1804,27 @@
       isc.addProperties(contextInfo, form.hiddenInputs);
       isc.addProperties(contextInfo, form.sessionAttributes);
     }
-    
+
     if (this.parentView) {
       // parent properties do not override contextInfo
       var parentContextInfo = this.parentView.getContextInfo(onlySessionProperties, classicMode, forceSettingContextVars, convertToClassicFormat);
       contextInfo = isc.addProperties(parentContextInfo, contextInfo);
     }
-    
+
     return contextInfo;
   },
-  
-  convertContextValue: function(value, type) {
+
+  convertContextValue: function (value, type) {
     var isTime = isc.isA.Date(value) && type && isc.SimpleType.getType(type).inheritsFrom === 'time';
     if (isTime) {
       return value.getUTCHours() + ':' + value.getUTCMinutes() + ':' + value.getUTCSeconds();
     }
     return value;
   },
-  
-  getPropertyDefinition: function(property) {
-    var properties = this.propertyToColumns, i, length = properties.length;
+
+  getPropertyDefinition: function (property) {
+    var properties = this.propertyToColumns,
+        i, length = properties.length;
     for (i = 0; i < length; i++) {
       if (property === properties[i].property) {
         return properties[i];
@@ -1790,8 +1832,8 @@
     }
     return null;
   },
-  
-  setContextInfo: function(sessionProperties, callbackFunction, forced){
+
+  setContextInfo: function (sessionProperties, callbackFunction, forced) {
     // no need to set the context in this case
     if (!forced && (this.isEditingGrid || this.isShowingForm)) {
       if (callbackFunction) {
@@ -1799,69 +1841,73 @@
       }
       return;
     }
-    
+
     if (!sessionProperties) {
       sessionProperties = this.getContextInfo(true, true, false, true);
     }
-    
+
     OB.RemoteCallManager.call('org.openbravo.client.application.window.FormInitializationComponent', sessionProperties, {
       MODE: 'SETSESSION',
       TAB_ID: this.tabId,
       PARENT_ID: this.getParentId(),
       ROW_ID: this.viewGrid.getSelectedRecord() ? this.viewGrid.getSelectedRecord().id : this.getCurrentValues().id
     }, callbackFunction);
-    
+
   },
-  
-  getTabMessage: function(forcedTabId){
-    var tabId = forcedTabId || this.tabId;
-    var callback = function(resp, data, req){
+
+  getTabMessage: function (forcedTabId) {
+    var tabId = forcedTabId || this.tabId,
+        callback;
+
+    callback = function (resp, data, req) {
       if (req.clientContext && data.type && (data.text || data.title)) {
         req.clientContext.messageBar.setMessage(isc.OBMessageBar[data.type], data.title, data.text);
       }
     };
-    
+
     OB.RemoteCallManager.call('org.openbravo.client.application.window.GetTabMessageActionHandler', {
       tabId: tabId
     }, null, callback, this);
   },
-  
-  getFormPersonalization: function(checkSavedView) {
+
+  getFormPersonalization: function (checkSavedView) {
     if (!this.standardWindow) {
       // happens during the initialization
       return null;
     }
     return this.standardWindow.getFormPersonalization(this, checkSavedView);
   },
-  
+
   // TODO: consider caching the prepared fields on
   // class level, the question is if it is faster
   // as then a clone action needs to be done
-  prepareFields: function() {
+  prepareFields: function () {
     // first compute the gridfields and then the formfields
     this.prepareViewFields(this.fields);
     this.gridFields = this.prepareGridFields(this.fields);
     this.formFields = this.prepareFormFields(this.fields);
   },
-  
-  prepareFormFields: function(fields) {
-    var i, length = fields.length, result = [], fld;
-    
+
+  prepareFormFields: function (fields) {
+    var i, length = fields.length,
+        result = [],
+        fld;
+
     for (i = 0; i < length; i++) {
       fld = isc.shallowClone(fields[i]);
       result.push(this.setFieldFormProperties(fld));
 
-      if(fld.firstFocusedField) {
+      if (fld.firstFocusedField) {
         this.firstFocusedField = fld.name;
       }
     }
-    
+
     return result;
   },
-  
-  setFieldFormProperties: function(fld) {
+
+  setFieldFormProperties: function (fld) {
     var onChangeFunction;
-    
+
     if (fld.displayed === false) {
       fld.visible = false;
       fld.alwaysTakeSpace = false;
@@ -1872,55 +1918,54 @@
     }
     if (fld.showIf && !fld.originalShowIf) {
       fld.originalShowIf = fld.showIf;
-      fld.showIf = function(item, value, form, values) {
+      fld.showIf = function (item, value, form, values) {
         var currentValues = values || form.view.getCurrentValues(),
-          context = form.getCachedContextInfo(), 
-          originalShowIfValue = false;
+            context = form.getCachedContextInfo(),
+            originalShowIfValue = false;
 
         OB.Utilities.fixNull250(currentValues);
-        
+
         try {
           originalShowIfValue = this.originalShowIf(item, value, form, currentValues, context);
-        } catch(_exception) {
+        } catch (_exception) {
           isc.warn(_exception + ' ' + _exception.message + ' ' + _exception.stack);
         }
-        
+
         return !this.hiddenInForm && context && originalShowIfValue;
       };
     }
     if (fld.type === 'OBAuditSectionItem') {
       var expandAudit = OB.PropertyStore.get('ShowAuditDefault', this.standardProperties.inpwindowId);
-      if (expandAudit && expandAudit==='Y') {
+      if (expandAudit && expandAudit === 'Y') {
         fld.sectionExpanded = true;
       }
     }
-    
+
     if (fld.onChangeFunction) {
       // the default
       fld.onChangeFunction.sort = 50;
-      
-      OB.OnChangeRegistry.register(this.tabId, fld.name, 
-          fld.onChangeFunction, 'default');
+
+      OB.OnChangeRegistry.register(this.tabId, fld.name, fld.onChangeFunction, 'default');
     }
-    
+
     return fld;
   },
-  
+
   // prepare stuff on view level
-  prepareViewFields: function(fields) {
-    var i, length = fields.length, fld;
-    
+  prepareViewFields: function (fields) {
+    var i, length = fields.length,
+        fld;
+
     // start with the initial ones
     this.propertyToColumns = this.initialPropertyToColumns.duplicate();
-    
+
     this.propertyToColumns.push({
-        property: this.standardProperties.keyProperty,
-        dbColumn: this.standardProperties.keyColumnName,
-        inpColumn: this.standardProperties.inpKeyName,
-        sessionProperty: true,
-        type: this.standardProperties.keyPropertyType
-      }
-    );
+      property: this.standardProperties.keyProperty,
+      dbColumn: this.standardProperties.keyColumnName,
+      inpColumn: this.standardProperties.inpKeyName,
+      sessionProperty: true,
+      type: this.standardProperties.keyPropertyType
+    });
 
     for (i = 0; i < length; i++) {
       fld = fields[i];
@@ -1935,43 +1980,44 @@
       }
     }
   },
-  
-  prepareGridFields: function(fields) {
-    var result = [], i, length = fields.length, fld, type,
-      expandFieldNames, hoverFunction, yesNoFormatFunction;
-    
-    hoverFunction = function(record, value, rowNum, colNum, grid) {
+
+  prepareGridFields: function (fields) {
+    var result = [],
+        i, length = fields.length,
+        fld, type, expandFieldNames, hoverFunction, yesNoFormatFunction;
+
+    hoverFunction = function (record, value, rowNum, colNum, grid) {
       return grid.getDisplayValue(colNum, record[(this.displayField ? this.displayField : this.name)]);
     };
 
-    yesNoFormatFunction = function(value, record, rowNum, colNum, grid) { 
+    yesNoFormatFunction = function (value, record, rowNum, colNum, grid) {
       return OB.Utilities.getYesNoDisplayValue(value);
     };
-    
+
     for (i = 0; i < length; i++) {
       fld = fields[i];
       if (!fld.gridProps) {
         continue;
       }
       fld = isc.shallowClone(fields[i]);
-      
+
       if (fld.showHover) {
         fld.hoverHTML = hoverFunction;
       }
-      
+
       if (fld.gridProps.length) {
         fld.gridProps.width = isc.OBGrid.getDefaultColumnWidth(fld.gridProps.length);
       }
-      
+
       // move the showif defined on form level
       // otherwise it interferes with the grid level
       if (fld.showIf) {
         fld.formShowIf = fld.showIf;
         delete fld.showIf;
       }
-      
+
       isc.addProperties(fld, fld.gridProps);
-      
+
       if (!fld.width) {
         fld.width = isc.OBGrid.getDefaultColumnWidth(30);
       }
@@ -1985,38 +2031,38 @@
       fld.canExport = (fld.canExport === false ? false : true);
       fld.canHide = (fld.canHide === false ? false : true);
       fld.canFilter = (fld.canFilter === false ? false : true);
-      fld.filterOnKeypress = (fld.filterOnKeypress === false ? false : true); 
+      fld.filterOnKeypress = (fld.filterOnKeypress === false ? false : true);
       fld.escapeHTML = (fld.escapeHTML === false ? false : true);
       fld.prompt = fld.title;
-      fld.editorProperties = isc.addProperties({}, fld, isc.shallowClone(fld.editorProps));      
+      fld.editorProperties = isc.addProperties({}, fld, isc.shallowClone(fld.editorProps));
       this.setFieldFormProperties(fld.editorProperties);
 
       if (fld.disabled) {
-       fld.editorProperties.disabled = true; 
+        fld.editorProperties.disabled = true;
       }
       fld.disabled = false;
-      
+
       if (fld.yesNo) {
-        fld.formatCellValue = yesNoFormatFunction; 
+        fld.formatCellValue = yesNoFormatFunction;
       }
-      
+
       type = isc.SimpleType.getType(fld.type);
       if (type.editorType && !fld.editorType) {
         fld.editorType = type.editorType;
       }
-      
+
       if (type.filterEditorType && !fld.filterEditorType) {
         fld.filterEditorType = type.filterEditorType;
       }
-      
+
       if (fld.fkField) {
         fld.displayField = fld.name + '.' + OB.Constants.IDENTIFIER;
         fld.valueField = fld.name;
       }
 
-      if(fld.validationFn) {
+      if (fld.validationFn) {
 
-        if(!fld.validators) {
+        if (!fld.validators) {
           fld.validators = [];
         }
 
@@ -2030,13 +2076,14 @@
         fld.filterEditorProperties = {};
       }
       fld.filterEditorProperties.required = false;
-      
+
       result.push(fld);
     }
-    
+
     // sort according to length, for the autoexpandfieldnames
-    result.sort(function(v1, v2) {
-      var t1 = v1.length, t2 = v2.length;
+    result.sort(function (v1, v2) {
+      var t1 = v1.length,
+          t2 = v2.length;
       if (!t1 && !t2) {
         return 0;
       }
@@ -2053,7 +2100,7 @@
       }
       return 1;
     });
-    
+
     this.autoExpandFieldNames = [];
     length = result.length;
     for (i = 0; i < length; i++) {
@@ -2061,11 +2108,12 @@
         this.autoExpandFieldNames.push(result[i].name);
       }
     }
-        
+
     // sort according to the sortnum
     // that's how they are displayed
-    result.sort(function(v1, v2) {
-      var t1 = v1.sort, t2 = v2.sort;
+    result.sort(function (v1, v2) {
+      var t1 = v1.sort,
+          t2 = v2.sort;
       if (!t1 && !t2) {
         return 0;
       }
@@ -2082,9 +2130,8 @@
       }
       return 1;
     });
-    
+
     return result;
   }
-  
-});
 
+});
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js	Sat Feb 11 15:48:44 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js	Sat Feb 11 16:19:47 2012 +0100
@@ -19,7 +19,8 @@
 isc.ClassFactory.defineClass('OBStandardWindow', isc.VLayout);
 
 isc.OBStandardWindow.addClassProperties({
-  COMMAND_NEW: 'NEW' // tells the window to open the first tab in new mode
+  // tells the window to open the first tab in new mode
+  COMMAND_NEW: 'NEW'
 });
 
 // = OBStandardWindow =
@@ -39,13 +40,13 @@
 isc.OBStandardWindow.addProperties({
   toolBarLayout: null,
   view: null,
-  
+
   viewProperties: null,
-  
+
   activeView: null,
-  
+
   views: [],
-  
+
   stackZIndex: 'firstOnTop',
   align: 'center',
   defaultLayoutAlign: 'center',
@@ -53,8 +54,8 @@
   // is set when a form or grid editing results in dirty data
   // in the window
   dirtyEditForm: null,
-  
-  initWidget: function(){
+
+  initWidget: function () {
     this.views = [];
 
     this.processLayout = isc.VStack.create({
@@ -65,22 +66,23 @@
     });
 
     this.addMember(this.processLayout);
-    
+
     this.toolBarLayout = isc.HLayout.create({
       mouseDownCancelParentPropagation: true,
       width: '100%',
-      height: 1, // is set by its content
+      // is set by its content
+      height: 1,
       overflow: 'visible'
     });
-    
+
     if (this.targetTabId) {
       // is used as a flag so that we are in direct link mode
       // prevents extra fetch data actions
       this.directTabInfo = {};
     }
-        
+
     this.addMember(this.toolBarLayout);
-    
+
     this.viewProperties.standardWindow = this;
     this.viewProperties.isRootView = true;
     if (this.command === isc.OBStandardWindow.COMMAND_NEW) {
@@ -92,10 +94,10 @@
     this.addMember(this.view);
 
     this.Super('initWidget', arguments);
-    
+
     // is set later after creation
     this.view.tabTitle = this.tabTitle;
-    
+
     // retrieve user specific window settings from the server
     // they are stored at class level to only do the call once
     // note this if is not done inside the method as this 
@@ -108,14 +110,15 @@
   },
 
   openProcess: function (params) {
-    var parts = this.getPrototype().Class.split('_'), 
+    var parts = this.getPrototype().Class.split('_'),
         len = parts.length,
         className = '_',
-        tabSet = OB.MainView.TabSet, vStack;
-    
+        tabSet = OB.MainView.TabSet,
+        vStack;
+
     if (params.windowId) {
       className = className + params.windowId;
-      if(len === 3) {
+      if (len === 3) {
         // debug mode, we have added _timestamp
         className = className + '_' + parts[2];
       }
@@ -135,28 +138,28 @@
   },
 
   refresh: function () {
-    var currentView = this.activeView, afterRefresh;
+    var currentView = this.activeView,
+        afterRefresh;
 
     afterRefresh = function () {
       // Refresh context view
       //contextView.getTabMessage();
       currentView.toolBar.refreshCustomButtons();
-//
-//      if (contextView !== currentView && currentView.state === isc.OBStandardView.STATE_TOP_MAX) {
-//        // Executing an action defined in parent tab, current tab is maximized,
-//        // let's set half for each in order to see the message
-//        contextView.setHalfSplit();
-//      }
-
+      //
+      //      if (contextView !== currentView && currentView.state === isc.OBStandardView.STATE_TOP_MAX) {
+      //        // Executing an action defined in parent tab, current tab is maximized,
+      //        // let's set half for each in order to see the message
+      //        contextView.setHalfSplit();
+      //      }
       // Refresh in order to show possible new records
       currentView.refresh(null, false, true);
     };
 
-    if(!currentView) {
+    if (!currentView) {
       return;
     }
 
-    if(this.selectedState) {
+    if (this.selectedState) {
       currentView.viewGrid.setSelectedState(this.selectedState);
       this.selectedState = null;
     }
@@ -176,22 +179,21 @@
     }
   },
 
-  readWindowSettings: function() {
+  readWindowSettings: function () {
     var standardWindow = this;
-    
+
     OB.RemoteCallManager.call('org.openbravo.client.application.WindowSettingsActionHandler', null, {
       windowId: this.windowId
-    }, function(response, data, request){
+    }, function (response, data, request) {
       standardWindow.setWindowSettings(data);
     });
   },
-  
+
   // set window specific user settings, purposely set on class level
-  setWindowSettings: function(data) {
-    var i, defaultView, persDefaultValue, views, length, t, tab, view, field, button, alwaysReadOnly,
-        st, stView, stBtns, stBtn, disabledFields;
+  setWindowSettings: function (data) {
+    var i, defaultView, persDefaultValue, views, length, t, tab, view, field, button, alwaysReadOnly, st, stView, stBtns, stBtn, disabledFields;
 
-    if (data){
+    if (data) {
       this.getClass().autoSave = data.autoSave;
       this.getClass().windowSettingsRead = true;
       this.getClass().uiPattern = data.uiPattern;
@@ -212,7 +214,7 @@
 
     // Field level permissions
     if (data && data.tabs) {
-      alwaysReadOnly = function(view, record, context) {
+      alwaysReadOnly = function (view, record, context) {
         return true;
       };
       for (t = 0; t < data.tabs.length; t++) {
@@ -224,7 +226,7 @@
           if (tab.fields[field.name] !== undefined) {
             field.updatable = tab.fields[field.name];
             field.disabled = !tab.fields[field.name];
-            if (!tab.fields[field.name]){
+            if (!tab.fields[field.name]) {
               disabledFields.push(field.name);
             }
           }
@@ -237,17 +239,17 @@
             field.editorProperties.disabled = !tab.fields[field.name];
           }
         }
-        for (i = 0; i <  view.toolBar.rightMembers.length; i++) {
+        for (i = 0; i < view.toolBar.rightMembers.length; i++) {
           button = view.toolBar.rightMembers[i];
           if (tab.tabId === button.contextView.tabId && button.property && !tab.fields[button.property]) {
             button.readOnlyIf = alwaysReadOnly;
             // looking for this button in subtabs
-            for (st = 0; st<this.views.length; st++) {
+            for (st = 0; st < this.views.length; st++) {
               stView = this.views[st];
-              if (stView===view) {
+              if (stView === view) {
                 continue;
               }
-              for (stBtns=0; stBtns < stView.toolBar.rightMembers.length; stBtns++){
+              for (stBtns = 0; stBtns < stView.toolBar.rightMembers.length; stBtns++) {
                 stBtn = stView.toolBar.rightMembers[stBtns];
                 if (stBtn.contextView === button.contextView && stBtn.property && !tab.fields[stBtn.property]) {
                   stBtn.readOnlyIf = alwaysReadOnly;
@@ -261,30 +263,32 @@
     }
   },
 
-  setPersonalization: function(personalization) {
+  setPersonalization: function (personalization) {
     var i, defaultView, persDefaultValue, views, length, me = this;
-    
+
     // only personalize if there is a professional license
     if (!OB.Utilities.checkProfessionalLicense(null, true)) {
       return;
     }
-    
+
     // cache the original view so that it can be restored
     if (!this.getClass().originalView) {
-      this.getClass().originalView = {originalView: true};
+      this.getClass().originalView = {
+        originalView: true
+      };
       this.getClass().originalView.personalizationId = 'dummyId';
       this.getClass().originalView.viewDefinition = OB.Personalization.getViewDefinition(this, '', false);
       this.getClass().originalView.viewDefinition.name = OB.I18N.getLabel('OBUIAPP_StandardView');
       this.getClass().originalView.canDelete = false;
-      
+
       // and clone the original view so that it can't get updated accidentally
       this.getClass().originalView = isc.clone(this.getClass().originalView);
     }
 
     this.getClass().personalization = personalization;
-    
+
     persDefaultValue = OB.PropertyStore.get('OBUIAPP_DefaultSavedView', this.windowId);
-    
+
     // find the default view, the personalizations are
     // returned in order of prio, then do sort by name
     if (this.getClass().personalization.views) {
@@ -306,12 +310,12 @@
           }
         }
       }
-      
+
       // apply the default view
       // maybe do this in a separate thread
       if (defaultView) {
         OB.Personalization.applyViewDefinition(defaultView.personalizationId, defaultView.viewDefinition, this);
-      } else { 
+      } else {
         // only apply the default form/grid if there are no views
         // otherwise you get strange interference
         // check the default form and grid viewstates
@@ -327,9 +331,10 @@
           }
         }
       }
-      
-      this.getClass().personalization.views.sort(function(v1, v2) {
-        var t1 = v1.viewDefinition.name, t2 = v2.viewDefinition.name;
+
+      this.getClass().personalization.views.sort(function (v1, v2) {
+        var t1 = v1.viewDefinition.name,
+            t2 = v2.viewDefinition.name;
         if (t1 < t2) {
           return -1;
         } else if (t1 === t2) {
@@ -340,35 +345,30 @@
     }
   },
 
-  clearLastViewPersonalization: function() {
+  clearLastViewPersonalization: function () {
     var p, length, personalization = this.getClass().personalization;
     delete this.lastViewApplied;
     if (personalization.forms) {
-      for (p in personalization.forms){
+      for (p in personalization.forms) {
         if (personalization.forms.hasOwnProperty(p) && personalization.forms[p].personalizationId) {
-          OB.RemoteCallManager.call(
-              'org.openbravo.client.application.personalization.PersonalizationActionHandler', 
-              {}, { 
-                personalizationId: personalization.forms[p].personalizationId,
-                action: 'delete'
-              },
-              null
-           );
+          OB.RemoteCallManager.call('org.openbravo.client.application.personalization.PersonalizationActionHandler', {}, {
+            personalizationId: personalization.forms[p].personalizationId,
+            action: 'delete'
+          }, null);
         }
       }
-      delete personalization.forms;    
+      delete personalization.forms;
     }
     delete this.viewState;
-    
+
     // remove the grid properties
-    OB.PropertyStore.set('OBUIAPP_GridConfiguration', null, this.windowId);    
+    OB.PropertyStore.set('OBUIAPP_GridConfiguration', null, this.windowId);
   },
-  
-  getDefaultGridViewState: function(tabId) {
-    var views, length, i, personalization = this.getClass().personalization,    
-      defaultView,
-      persDefaultValue = OB.PropertyStore.get('OBUIAPP_DefaultSavedView', this.windowId);
-    
+
+  getDefaultGridViewState: function (tabId) {
+    var views, length, i, personalization = this.getClass().personalization,
+        defaultView, persDefaultValue = OB.PropertyStore.get('OBUIAPP_DefaultSavedView', this.windowId);
+
     if (personalization && personalization.views) {
       views = personalization.views;
       length = views.length;
@@ -389,42 +389,38 @@
         }
       }
     }
-    
-    if (defaultView && defaultView.viewDefinition && 
-        defaultView.viewDefinition[tabId]) {
+
+    if (defaultView && defaultView.viewDefinition && defaultView.viewDefinition[tabId]) {
       return defaultView.viewDefinition[tabId].grid;
-    } 
-        
+    }
+
     if (this.viewState && this.viewState[tabId]) {
       return this.viewState[tabId];
     }
-    
+
     return null;
   },
-  
+
   // Update the personalization record which is stored 
-  updateFormPersonalization: function(view, formPersonalization) {
+  updateFormPersonalization: function (view, formPersonalization) {
     if (!this.getClass().personalization) {
       this.getClass().personalization = {};
-     }
+    }
     if (!this.getClass().personalization.forms) {
       this.getClass().personalization.forms = [];
     }
     this.getClass().personalization.forms[view.tabId] = formPersonalization;
-   },
-   
-  getFormPersonalization: function(view, checkSavedView) {
+  },
+
+  getFormPersonalization: function (view, checkSavedView) {
     var formPersonalization, i, persView;
     if (!this.getClass().personalization || !this.getClass().personalization.forms) {
       // no form personalization on form level
       // check window level
-      if (checkSavedView && this.getClass().personalization && this.getClass().personalization.views 
-          && this.selectedPersonalizationId) {
+      if (checkSavedView && this.getClass().personalization && this.getClass().personalization.views && this.selectedPersonalizationId) {
         for (i = 0; i < this.getClass().personalization.views.length; i++) {
           persView = this.getClass().personalization.views[i];
-          if (persView.viewDefinition && 
-              persView.viewDefinition[view.tabId] && 
-              persView.personalizationId === this.selectedPersonalizationId) {
+          if (persView.viewDefinition && persView.viewDefinition[view.tabId] && persView.personalizationId === this.selectedPersonalizationId) {
             return persView.viewDefinition[view.tabId].form;
           }
         }
@@ -436,8 +432,9 @@
     return formPersonalization[view.tabId];
   },
 
-  removeAllFormPersonalizations: function() {
-    var i, updateButtons = false, length = this.views.length;
+  removeAllFormPersonalizations: function () {
+    var i, updateButtons = false,
+        length = this.views.length;
     if (!this.getClass().personalization) {
       return;
     }
@@ -450,11 +447,11 @@
     }
   },
 
-  isAutoSaveEnabled: function(){
+  isAutoSaveEnabled: function () {
     return this.getClass().autoSave;
   },
 
-  getDirtyEditForm: function() {
+  getDirtyEditForm: function () {
     return this.dirtyEditForm;
   },
 
@@ -465,15 +462,16 @@
     }
   },
 
-  autoSave: function() {
+  autoSave: function () {
     this.doActionAfterAutoSave(null, false);
   },
 
-  doActionAfterAutoSave: function(action, forceDialogOnFailure, ignoreAutoSaveEnabled) {
-    var me = this;
+  doActionAfterAutoSave: function (action, forceDialogOnFailure, ignoreAutoSaveEnabled) {
+    var me = this,
+        saveCallback;
 
-    var saveCallback = function(ok){
-      if (!ok){
+    saveCallback = function (ok) {
+      if (!ok) {
         if (me.getDirtyEditForm()) {
           me.getDirtyEditForm().resetForm();
         }
@@ -482,7 +480,7 @@
         }
         return;
       }
-      
+
       // if not dirty or we know that the object has errors
       if (!me.getDirtyEditForm() || (me.getDirtyEditForm() && !me.getDirtyEditForm().validateForm())) {
         // clean up before calling the action, as the action
@@ -528,7 +526,7 @@
     }
   },
 
-  callAutoSaveAction: function() {
+  callAutoSaveAction: function () {
     var action = this.autoSaveAction;
     this.cleanUpAutoSaveProperties();
     if (!action) {
@@ -537,14 +535,14 @@
     OB.Utilities.callAction(action);
   },
 
-  cleanUpAutoSaveProperties: function() {
+  cleanUpAutoSaveProperties: function () {
     delete this.dirtyEditForm;
     delete this.isAutoSaving;
     delete this.autoSaveAction;
     delete this.forceDialogOnFailure;
   },
 
-  autoSaveDone: function(view, success) {
+  autoSaveDone: function (view, success) {
     if (!this.isAutoSaving) {
       this.cleanUpAutoSaveProperties();
       return;
@@ -559,18 +557,20 @@
     }
     this.cleanUpAutoSaveProperties();
   },
-  
-  autoSaveConfirmAction: function(){
-    var action = this.autoSaveAction, me = this;
+
+  autoSaveConfirmAction: function () {
+    var action = this.autoSaveAction,
+        me = this,
+        callback;
     this.autoSaveAction = null;
 
-    
+
     if (this.isAutoSaveEnabled()) {
       // clean up everything
       me.cleanUpAutoSaveProperties();
     }
 
-    var callback = function(ok){
+    callback = function (ok) {
       delete me.inAutoSaveConfirmation;
       if (ok) {
         if (me.getDirtyEditForm()) {
@@ -589,11 +589,12 @@
         }
       }
     };
+
     this.inAutoSaveConfirmation = true;
     isc.ask(OB.I18N.getLabel('OBUIAPP_AutoSaveNotPossibleExecuteAction'), callback);
   },
-  
-  addView: function(view){
+
+  addView: function (view) {
     view.standardWindow = this;
     this.views.push(view);
     this.toolBarLayout.addMember(view.toolBar);
@@ -603,14 +604,14 @@
   },
 
   // is called from the main app tabset. Redirects to custom viewSelected
-  tabSelected: function(tabNum, tabPane, ID, tab) {
+  tabSelected: function (tabNum, tabPane, ID, tab) {
     if (this.activeView && this.activeView.setViewFocus) {
       this.activeView.setViewFocus();
     }
   },
 
   // is called from the main app tabset. Redirects to custom viewDeselected
-  tabDeselected: function(tabNum, tabPane, ID, tab, newTab){
+  tabDeselected: function (tabNum, tabPane, ID, tab, newTab) {
     this.wasDeselected = true;
   },
 
@@ -618,7 +619,7 @@
   //
   // Called from the main app tabset
   // Selects the parent tab of the current selected and active tab (independently of its level)
-  selectParentTab: function(mainTabSet) {
+  selectParentTab: function (mainTabSet) {
     if (!this.activeView.parentView) {
       return false;
     }
@@ -636,12 +637,12 @@
     parentTabSet.selectTab(parentTabNum);
     if (parentTabPane.setAsActiveView) {
       parentTabPane.setAsActiveView();
-      isc.Timer.setTimeout(function(){ // Inside a timeout like in itemClick case. Also to avoid a strange effect that child tab not deployed properly
+      isc.Timer.setTimeout(function () { // Inside a timeout like in itemClick case. Also to avoid a strange effect that child tab not deployed properly
         parentTabSet.doHandleClick();
       }, 0);
     } else if (parentTabPane.view.setAsActiveView) {
       parentTabPane.view.setAsActiveView();
-      isc.Timer.setTimeout(function(){ // Inside a timeout like in itemClick case. Also to avoid a strange effect that parent tab not deployed properly
+      isc.Timer.setTimeout(function () { // Inside a timeout like in itemClick case. Also to avoid a strange effect that parent tab not deployed properly
         parentTabPane.view.doHandleClick();
       }, 0);
     }
@@ -651,7 +652,7 @@
   //
   // Called from the main app tabset
   // Selects the child tab of the current selected and active tab (independently of its level)
-  selectChildTab: function(mainTabSet) {
+  selectChildTab: function (mainTabSet) {
     var childTabSet = this.activeView.childTabSet;
 
     if (!childTabSet) {
@@ -665,7 +666,7 @@
     childTabSet.selectTab(childTabNum);
     if (childTabPane.setAsActiveView) {
       childTabPane.setAsActiveView();
-      isc.Timer.setTimeout(function(){ // Inside a timeout like in itemClick case. Also to avoid a strange effect that child tab not deployed properly
+      isc.Timer.setTimeout(function () { // Inside a timeout like in itemClick case. Also to avoid a strange effect that child tab not deployed properly
         childTabSet.doHandleClick();
       }, 0);
     }
@@ -675,7 +676,7 @@
   //
   // Called from the main app tabset
   // Selects the previous tab of the current selected and active tab (independently of its level)
-  selectPreviousTab: function(mainTabSet) {
+  selectPreviousTab: function (mainTabSet) {
     var activeTabSet = this.activeView.parentTabSet;
     if (!activeTabSet) { // If activeTabSet is null means that we are in the top level
       activeTabSet = mainTabSet;
@@ -684,11 +685,11 @@
         activeTabNum = activeTabSet.getTabNumber(activeTab),
         activeTabPane = activeTabSet.getTabPane(activeTab);
 
-    if ((activeTabNum-1) < 0) {
+    if ((activeTabNum - 1) < 0) {
       return false;
     }
 
-    activeTabSet.selectTab(activeTabNum-1);
+    activeTabSet.selectTab(activeTabNum - 1);
 
     // after select the new tab, activeTab related variables are updated
     activeTab = activeTabSet.getSelectedTab();
@@ -705,7 +706,7 @@
   //
   // Called from the main app tabset
   // Selects the next tab of the current selected and active tab (independently of its level)
-  selectNextTab: function(mainTabSet) {
+  selectNextTab: function (mainTabSet) {
     var activeTabSet = this.activeView.parentTabSet;
     if (!activeTabSet) { // If activeTabSet is null means that we are in the top level
       activeTabSet = mainTabSet;
@@ -714,11 +715,11 @@
         activeTabNum = activeTabSet.getTabNumber(activeTab),
         activeTabPane = activeTabSet.getTabPane(activeTab);
 
-    if ((activeTabNum+1) >= activeTabSet.tabs.getLength()) {
+    if ((activeTabNum + 1) >= activeTabSet.tabs.getLength()) {
       return false;
     }
 
-    activeTabSet.selectTab(activeTabNum+1);
+    activeTabSet.selectTab(activeTabNum + 1);
 
     // after select the new tab, activeTab related variables are updated
     activeTab = activeTabSet.getSelectedTab();
@@ -730,8 +731,8 @@
       activeTabPane.setAsActiveView();
     }
   },
-  
-  closeClick: function(tab, tabSet){
+
+  closeClick: function (tab, tabSet) {
     if (!this.activeView.viewForm.hasChanged && this.activeView.viewForm.isNew) {
       this.view.standardWindow.setDirtyEditForm(null);
     }
@@ -743,15 +744,15 @@
     };
     this.doActionAfterAutoSave(actionObject, false);
   },
-  
-  setActiveView: function(view){
+
+  setActiveView: function (view) {
     if (!this.isDrawn()) {
       return;
     }
     if (this.activeView === view) {
       return;
     }
-    
+
     var currentView = this.activeView;
     // note the new activeView must be set before disabling
     // the other one
@@ -761,22 +762,22 @@
     }
     view.setActiveViewProps(true);
   },
-  
-  setFocusInView: function(view){
+
+  setFocusInView: function (view) {
     var currentView = view || this.activeView || this.view;
     this.setActiveView(currentView);
   },
 
-  show: function() {
+  show: function () {
     var ret = this.Super('show', arguments);
     this.setFocusInView();
     return ret;
   },
 
-  draw: function(){
-    var standardWindow = this, targetEntity,
-        ret = this.Super('draw', arguments), i,
-        length = this.views.length;
+  draw: function () {
+    var standardWindow = this,
+        targetEntity, ret = this.Super('draw', arguments),
+        i, length = this.views.length;
     if (this.targetTabId) {
       for (i = 0; i < length; i++) {
         if (this.views[i].tabId === this.targetTabId) {
@@ -795,16 +796,16 @@
     } else {
       this.setFocusInView(this.view);
     }
-    
+
     return ret;
   },
-  
-  setViewTabId: function(viewTabId){
+
+  setViewTabId: function (viewTabId) {
     this.view.viewTabId = viewTabId;
     this.viewTabId = viewTabId;
   },
-  
-  doHandleClick: function(){
+
+  doHandleClick: function () {
     // happens when we are getting selected
     // then don't change state
     if (this.wasDeselected) {
@@ -814,8 +815,8 @@
     this.setActiveView(this.view);
     this.view.doHandleClick();
   },
-  
-  doHandleDoubleClick: function(){
+
+  doHandleDoubleClick: function () {
     // happens when we are getting selected
     // then don't change state
     if (this.wasDeselected) {
@@ -825,21 +826,20 @@
     this.setActiveView(this.view);
     this.view.doHandleDoubleClick();
   },
-  
+
   // +++++++++++++ Methods for the main tab handling +++++++++++++++++++++
-  
-  getHelpView: function(){
+  getHelpView: function () {
     // tabTitle is set in the viewManager
     return {
-        viewId: 'ClassicOBHelp',
-        tabTitle: this.tabTitle + ' - ' + OB.I18N.getLabel('UINAVBA_Help'),
-        windowId: this.windowId,
-        windowType: 'W',
-        windowName: this.tabTitle
+      viewId: 'ClassicOBHelp',
+      tabTitle: this.tabTitle + ' - ' + OB.I18N.getLabel('UINAVBA_Help'),
+      windowId: this.windowId,
+      windowType: 'W',
+      windowName: this.tabTitle
     };
   },
-  
-  getBookMarkParams: function(){
+
+  getBookMarkParams: function () {
     var result = {};
     result.windowId = this.windowId;
     result.viewId = this.getClassName();
@@ -850,13 +850,13 @@
     }
     return result;
   },
-  
-  isEqualParams: function(params){
+
+  isEqualParams: function (params) {
     var equalTab = params.windowId && params.windowId === this.windowId;
     return equalTab;
   },
-  
-  isSameTab: function(viewName, params){
+
+  isSameTab: function (viewName, params) {
     // always return false to force new tabs
     if (this.multiDocumentEnabled) {
       return false;
@@ -864,30 +864,31 @@
     return this.isEqualParams(params) && viewName === this.getClassName();
   },
 
-  setTargetInformation: function(tabId, recordId) {
+  setTargetInformation: function (tabId, recordId) {
     this.targetTabId = tabId;
     this.targetRecordId = recordId;
     OB.Layout.HistoryManager.updateHistory();
   },
-  
-  getView: function(tabId) {
+
+  getView: function (tabId) {
     // find is a SC extension on arrays
     return this.views.find('tabId', tabId);
   },
 
-  storeViewState: function(){
-    var result = {}, i, length = this.views.length;
-    
+  storeViewState: function () {
+    var result = {},
+        i, length = this.views.length;
+
     if (!OB.Utilities.checkProfessionalLicense(null, true)) {
       return;
     }
-    
+
     for (i = 0; i < length; i++) {
-      if ( this.views[i].viewGrid ) {
+      if (this.views[i].viewGrid) {
         result[this.views[i].tabId] = this.views[i].viewGrid.getViewState();
       }
     }
     this.viewState = result;
     OB.PropertyStore.set('OBUIAPP_GridConfiguration', result, this.windowId);
   }
-});
+});
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-tab.js	Sat Feb 11 15:48:44 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-tab.js	Sat Feb 11 16:19:47 2012 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2011 Openbravo SLU
+ * All portions are Copyright (C) 2010-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -40,10 +40,10 @@
 
     dblClickWaiting: false,
 
-    itemClick: function(item, itemNum){
+    itemClick: function (item, itemNum) {
       var me = this;
       me.dblClickWaiting = true;
-      isc.Timer.setTimeout(function(){
+      isc.Timer.setTimeout(function () {
         // if no double click happened then do the single click
         if (me.dblClickWaiting) {
           me.dblClickWaiting = false;
@@ -54,7 +54,7 @@
       }, OB.Constants.DBL_CLICK_DELAY);
 
     },
-    itemDoubleClick: function(item, itemNum){
+    itemDoubleClick: function (item, itemNum) {
       this.dblClickWaiting = false;
       if (this.tabSet.selectedTab === itemNum && item.pane.doHandleDoubleClick) {
         item.pane.doHandleDoubleClick();
@@ -62,7 +62,7 @@
     }
   }),
 
-  tabSelected: function(tabNum, tabPane, ID, tab) {
+  tabSelected: function (tabNum, tabPane, ID, tab) {
     if (!tabPane.isLoadingTab) {
       OB.Layout.HistoryManager.updateHistory();
     }
@@ -80,7 +80,7 @@
     }
   },
 
-  closeClick: function(tab) {
+  closeClick: function (tab) {
     if (tab.pane && tab.pane.closeClick) {
       tab.pane.closeClick(tab, this);
     } else {
@@ -88,36 +88,37 @@
     }
   },
 
-  doCloseClick: function(tab) {
+  doCloseClick: function (tab) {
     if (tab && tab.pane) {
       tab.pane.closing = true;
     }
     return this.Super('closeClick', arguments);
   },
 
-  initWidget: function() {
+  initWidget: function () {
     this.tabBarProperties.tabSet = this;
     this.Super('initWidget', arguments);
   },
 
-  draw : function() {
-    var me = this;
-    var ksAction_CloseSelectedTab = function() {
+  draw: function () {
+    var me = this,
+        ksAction_CloseSelectedTab, ksAction_SelectParentTab, ksAction_SelectChildTab, ksAction_SelectPreviousTab, ksAction_SelectNextTab, ksAction_SelectWorkspaceTab;
+    ksAction_CloseSelectedTab = function () {
       me.closeSelectedTab();
       return false; //To avoid keyboard shortcut propagation
     };
     OB.KeyboardManager.Shortcuts.set('TabSet_CloseSelectedTab', 'Canvas', ksAction_CloseSelectedTab);
-    var ksAction_SelectParentTab = function() {
+    ksAction_SelectParentTab = function () {
       me.selectParentTab();
       return false; //To avoid keyboard shortcut propagation
     };
     OB.KeyboardManager.Shortcuts.set('TabSet_SelectParentTab', 'Canvas', ksAction_SelectParentTab);
-    var ksAction_SelectChildTab = function() {
+    ksAction_SelectChildTab = function () {
       me.selectChildTab();
       return false; //To avoid keyboard shortcut propagation
     };
     OB.KeyboardManager.Shortcuts.set('TabSet_SelectChildTab', 'Canvas', ksAction_SelectChildTab);
-    var ksAction_SelectPreviousTab = function() {
+    ksAction_SelectPreviousTab = function () {
       if (!isc.Page.isRTL()) { // LTR mode
         me.selectPreviousTab();
       } else { // RTL mode
@@ -126,7 +127,7 @@
       return false; //To avoid keyboard shortcut propagation
     };
     OB.KeyboardManager.Shortcuts.set('TabSet_SelectPreviousTab', 'Canvas', ksAction_SelectPreviousTab);
-    var ksAction_SelectNextTab = function() {
+    ksAction_SelectNextTab = function () {
       if (!isc.Page.isRTL()) { // LTR mode
         me.selectNextTab();
       } else { // RTL mode
@@ -135,7 +136,7 @@
       return false; //To avoid keyboard shortcut propagation
     };
     OB.KeyboardManager.Shortcuts.set('TabSet_SelectNextTab', 'Canvas', ksAction_SelectNextTab);
-    var ksAction_SelectWorkspaceTab = function() {
+    ksAction_SelectWorkspaceTab = function () {
       me.selectTab(0);
       return false; //To avoid keyboard shortcut propagation
     };
@@ -143,14 +144,15 @@
     this.Super('draw', arguments);
   },
 
-  closeAllTabs: function() { // Except "Workspace" tab
-    var tabCount, tabArray = [], i;
+  closeAllTabs: function () { // Except "Workspace" tab
+    var tabCount, tabArray = [],
+        i;
     for (i = 1; i > 0; i++) {
       if (typeof this.getTab(i) === 'undefined') {
         break;
       }
     }
-    tabCount = i-1;
+    tabCount = i - 1;
     this.selectTab(0);
     for (i = 1; i <= tabCount; i++) {
       tabArray.push(i);
@@ -158,14 +160,14 @@
     this.removeTabs(tabArray);
   },
 
-  closeSelectedTab: function() { // Only if selected tab is closable
+  closeSelectedTab: function () { // Only if selected tab is closable
     var selectedTab = this.getSelectedTab();
     if (selectedTab.canClose) {
       this.removeTabs(selectedTab);
     }
   },
 
-  selectParentTab : function() {
+  selectParentTab: function () {
     var tabSet = this,
         tab = tabSet.getSelectedTab(),
         ID = tab.ID,
@@ -179,7 +181,7 @@
     return true;
   },
 
-  selectChildTab : function() {
+  selectChildTab: function () {
     var tabSet = this,
         tab = tabSet.getSelectedTab(),
         ID = tab.ID,
@@ -193,7 +195,7 @@
     return true;
   },
 
-  selectPreviousTab : function(doDefaultAction) {
+  selectPreviousTab: function (doDefaultAction) {
     var tabSet = this,
         tab = tabSet.getSelectedTab(),
         ID = tab.ID,
@@ -207,13 +209,13 @@
     if (!doDefaultAction && tabPane.selectPreviousTab) { //Redirect if tabPane has its own selectPreviousTab handler
       tabPane.selectPreviousTab(tabSet);
     } else {
-      tabSet.selectTab(tabNum-1);
+      tabSet.selectTab(tabNum - 1);
     }
 
     return true;
   },
 
-  selectNextTab : function(doDefaultAction) {
+  selectNextTab: function (doDefaultAction) {
     var tabSet = this,
         tab = tabSet.getSelectedTab(),
         ID = tab.ID,
@@ -227,16 +229,17 @@
     if (!doDefaultAction && tabPane.selectNextTab) { //Redirect if tabPane has its own selectNextTab handler
       tabPane.selectNextTab(tabSet);
     } else {
-      tabSet.selectTab(tabNum+1);
+      tabSet.selectTab(tabNum + 1);
     }
 
     return true;
   },
 
   // is used by selenium
-  getTabFromTitle : function(title) {
-    var index = 0, tab = null;
-    for (; index < OB.MainView.TabSet.tabs.getLength();index++) {
+  getTabFromTitle: function (title) {
+    var index = 0,
+        tab = null;
+    for (; index < OB.MainView.TabSet.tabs.getLength(); index++) {
       tab = OB.MainView.TabSet.getTabObject(index);
       if (tab.title === title) {
         return tab;
@@ -245,16 +248,16 @@
     return null;
   },
 
-  removeTabs: function(tabs, destroyPanes) {
+  removeTabs: function (tabs, destroyPanes) {
     var i, tab, appFrame, tabsLength, toRemove = [],
         tabSet = OB.MainView.TabSet;
 
-    if(!tabs) {
+    if (!tabs) {
       return;
     }
 
     if (!isc.isAn.Array(tabs)) {
-        tabs = [tabs];
+      tabs = [tabs];
     }
 
     // get the actual tab button object from whatever was passed in.
@@ -265,13 +268,12 @@
 
     for (i = 0; i < tabsLength; i++) {
       tab = tabSet.getTab(tabs[i].ID);
-      if(tab.pane.Class === 'OBClassicWindow') {
+      if (tab.pane.Class === 'OBClassicWindow') {
 
-        appFrame = tab.pane.appFrameWindow ||
-                   tab.pane.getAppFrameWindow();
+        appFrame = tab.pane.appFrameWindow || tab.pane.getAppFrameWindow();
 
-        if(appFrame && appFrame.isUserChanges) {
-          if(appFrame.validate && !appFrame.validate()) {
+        if (appFrame && appFrame.isUserChanges) {
+          if (appFrame.validate && !appFrame.validate()) {
             return false;
           }
           tab.pane.saveRecord(tabs[i].ID);
@@ -291,17 +293,20 @@
 
   updateTab: function (tab, pane, refresh) {
     var previousPane = tab && this.getTabObject(tab).pane;
-    
+
     this.Super('updateTab', arguments);
 
     // Note: updateTab doesn't remove the previous loading tab
     // http://www.smartclient.com/docs/8.1/a/b/c/go.html#method..TabSet.updateTab
-    if(previousPane && previousPane.isLoadingTab) {
+    if (previousPane && previousPane.isLoadingTab) {
       previousPane.destroy();
     }
 
-    if(refresh && pane.refresh) {
-      this.fireOnPause('refreshRecordInView', {target: pane, methodName: 'refresh'}, 120);
+    if (refresh && pane.refresh) {
+      this.fireOnPause('refreshRecordInView', {
+        target: pane,
+        methodName: 'refresh'
+      }, 120);
     }
   }
 });
@@ -309,12 +314,11 @@
 isc.ClassFactory.defineClass('OBTabBarMain', isc.OBTabBar);
 
 isc.OBTabBarMain.addProperties({
-  initWidget: function() {
+  initWidget: function () {
     this.Super('initWidget', arguments);
   },
 
-
-  keyPress: function() {
+  keyPress: function () {
     var ret;
     this.tabWithinToolbar = true;
     ret = this.Super('keyPress', arguments);
@@ -329,10 +333,10 @@
 isc.OBTabBarButtonChild.addProperties({
   // when a tab is drawn the first time it steals the focus 
   // from the active view, prevent this
-  focus: function() {
-     if (this.pane.isActiveView && this.pane.isActiveView()) {
-       this.Super('focus', arguments);
-     }
+  focus: function () {
+    if (this.pane.isActiveView && this.pane.isActiveView()) {
+      this.Super('focus', arguments);
+    }
   }
 });
 
@@ -348,7 +352,7 @@
 
     dblClickWaiting: false,
 
-    click: function() {
+    click: function () {
       if (this.itemClicked) {
         delete this.itemClicked;
         return false;
@@ -356,7 +360,7 @@
       this.tabSet.doHandleClick();
     },
 
-    doubleClick: function() {
+    doubleClick: function () {
       if (this.itemClicked || this.itemDoubleClicked) {
         delete this.itemClicked;
         delete this.itemDoubleClicked;
@@ -364,21 +368,22 @@
       }
       this.tabSet.doHandleDoubleClick();
     },
-    
+
     canDrag: false,
     dragAppearance: 'none',
     dragStartDistance: 1,
     overflow: 'hidden',
 
-    itemClick: function(item, itemNum){
-      var me = this, tab = item;
+    itemClick: function (item, itemNum) {
+      var me = this,
+          tab = item;
       this.itemClicked = true;
       if (this.tabSet.ignoreItemClick) {
         delete this.tabSet.ignoreItemClick;
         return false;
       }
       me.dblClickWaiting = true;
-      isc.Timer.setTimeout(function(){
+      isc.Timer.setTimeout(function () {
         // if no double click happened then do the single click
         if (me.dblClickWaiting) {
           me.dblClickWaiting = false;
@@ -388,38 +393,38 @@
       return false;
     },
 
-    itemDoubleClick: function(item, itemNum){
+    itemDoubleClick: function (item, itemNum) {
       this.dblClickWaiting = false;
       this.itemDoubleClicked = true;
       this.tabSet.doHandleDoubleClick();
     },
 
-    dragStop: function(){
+    dragStop: function () {
       // change the height to percentage based to handle resizing of browser:
       this.tabSet.parentContainer.convertToPercentageHeights();
       this.setCursor(isc.Canvas.ROW_RESIZE);
       return true;
     },
 
-    mouseDown: function() {
+    mouseDown: function () {
       if (this.tabSet.state === isc.OBStandardView.STATE_IN_MID) {
         this.setCursor(isc.Canvas.MOVE);
       }
     },
 
-    mouseUp: function() {
+    mouseUp: function () {
       if (this.tabSet.state === isc.OBStandardView.STATE_IN_MID) {
         this.setCursor(isc.Canvas.ROW_RESIZE);
       }
     },
 
-    mouseOut: function() {
+    mouseOut: function () {
       if (this.tabSet.state === isc.OBStandardView.STATE_IN_MID) {
         this.setCursor(isc.Canvas.ROW_RESIZE);
       }
     },
 
-    mouseOver: function() {
+    mouseOver: function () {
       if (this.tabSet.state === isc.OBStandardView.STATE_IN_MID) {
         this.setCursor(isc.Canvas.ROW_RESIZE);
       } else {
@@ -427,7 +432,7 @@
       }
     },
 
-    getCurrentCursor: function() {
+    getCurrentCursor: function () {
       if (this.tabSet.state === isc.OBStandardView.STATE_IN_MID) {
         if (isc.EventHandler.leftButtonDown()) {
           return isc.Canvas.MOVE;
@@ -437,14 +442,14 @@
       return this.Super('getCurrentCursor', arguments);
     },
 
-    dragStart: function(){
+    dragStart: function () {
       // -2 to prevent scrollbar
       this.tabSet.maxHeight = this.tabSet.parentContainer.getHeight() - 2;
       this.tabSet.minHeight = (this.getHeight() * 2) + 15;
       return true;
     },
 
-    dragMove: function(){
+    dragMove: function () {
       var offset = -1 * isc.EH.dragOffsetY;
       this.resizeTarget(this.tabSet, true, true, offset, -1 * this.getHeight(), null, true);
       this.tabSet.draggedHeight = this.tabSet.getHeight();
@@ -463,7 +468,7 @@
   // keeps track of the previous dragged height, to restore it
   draggedHeight: null,
 
-  setDraggable: function(draggable){
+  setDraggable: function (draggable) {
     if (draggable) {
       this.tabBar.canDrag = true;
       this.tabBar.cursor = isc.Canvas.ROW_RESIZE;
@@ -473,7 +478,7 @@
     }
   },
 
-  doHandleClick: function(){
+  doHandleClick: function () {
     if (this.state === isc.OBStandardView.STATE_MIN) {
       // we are minimized, there must be a parent then
       if (this.parentTabSet) {
@@ -494,7 +499,7 @@
     }
   },
 
-  doHandleDoubleClick: function(){
+  doHandleDoubleClick: function () {
     if (this.state === isc.OBStandardView.STATE_TOP_MAX) {
       // we are maximized go back to the previous state
       if (this.previousState && this.previousState !== this.state) {
@@ -519,17 +524,16 @@
     }
   },
 
-  getState: function(){
+  getState: function () {
     return this.state;
   },
 
-  setState: function(newState){
+  setState: function (newState) {
     // disabled this as sometimes states have
     // to be reset to recompute heights changed automatically
     // if (this.state === newState) {
     // return;
     // }
-
     var tab, i, pane;
     var tmpPreviousState = this.state;
     var length = this.tabs.length;
@@ -621,9 +625,9 @@
     }
   },
 
-  makeTabVisible: function(tab){
+  makeTabVisible: function (tab) {
     var pane;
-    
+
     if (tab === this.getSelectedTab()) {
       pane = this.getTabPane(tab);
       pane.show();
@@ -636,24 +640,23 @@
       if (pane.members[1]) {
         pane.members[1].show();
       }
-//      this.selectTab(tab);
+      //      this.selectTab(tab);
     }
   },
 
-  tabSelected: function(tabNum, tabPane, ID, tab){
+  tabSelected: function (tabNum, tabPane, ID, tab) {
     var event = isc.EventHandler.getLastEvent();
     if (tabPane.refreshContents) {
       tabPane.doRefreshContents(true, true);
     }
     // if the event is a mouse event then let the item click not do max/min
     // tabselected events are also fired when drawing
-    if (this.isDrawn() && event && isc.EventHandler.isMouseEvent(event.eventType) && tabPane.parentView &&
-        tabPane.parentView.state !== isc.OBStandardView.STATE_TOP_MAX && tabPane.parentView.state !== isc.OBStandardView.STATE_MID) {
+    if (this.isDrawn() && event && isc.EventHandler.isMouseEvent(event.eventType) && tabPane.parentView && tabPane.parentView.state !== isc.OBStandardView.STATE_TOP_MAX && tabPane.parentView.state !== isc.OBStandardView.STATE_MID) {
       this.ignoreItemClick = true;
     }
   },
 
-  initWidget: function(){
+  initWidget: function () {
     this.tabBarProperties.tabSet = this;
     this.Super('initWidget', arguments);
   }
@@ -662,7 +665,7 @@
 isc.ClassFactory.defineClass('OBTabBarChild', isc.OBTabBar);
 
 isc.OBTabBarChild.addProperties({
-  initWidget: function() {
+  initWidget: function () {
     this.Super('initWidget', arguments);
   }
-});
+});
\ No newline at end of file