details:   /erp/devel/pi/rev/c0ff2a2d0d3d
changeset: 9830:c0ff2a2d0d3d
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Sat Jan 15 08:59:57 2011 +0100
summary:   Statusbar and toolbar buttons are added to the testregistry

details:   /erp/devel/pi/rev/8f802cc2e06e
changeset: 9831:8f802cc2e06e
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Sat Jan 15 09:00:19 2011 +0100
summary:   Changed comments

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
 |   5 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-statusbar.js
     |   5 +
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js
       |  27 +++++----
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
     |   6 --
 4 files changed, 24 insertions(+), 19 deletions(-)

diffs (157 lines):

diff -r 589b555e9f05 -r 8f802cc2e06e 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
      Sat Jan 15 00:40:32 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
      Sat Jan 15 09:00:19 2011 +0100
@@ -205,7 +205,10 @@
   },
   
   setDataSource: function(ds){
-    //Wrap DataSource with OBDataSource which overrides methods to set tab 
info7
+    // Wrap DataSource with OBDataSource:
+    // - to set/reset the progress icons
+    // - to handle error cases in the response
+    // - to add info to the request
     var obDsClassname = 'OBDataSource' + this.tabId;
     isc.defineClass(obDsClassname, ds.getClass());
     
diff -r 589b555e9f05 -r 8f802cc2e06e 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-statusbar.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-statusbar.js
  Sat Jan 15 00:40:32 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-statusbar.js
  Sat Jan 15 09:00:19 2011 +0100
@@ -126,6 +126,11 @@
     var buttonBar = isc.OBStatusBarIconButtonBar.create({});
     
     buttonBar.addMembers([this.previousButton, this.nextButton, buttonSpacer, 
this.maximizeButton, this.restoreButton, closeButton]);
+    for (var i = 0; i < buttonBar.members.length; i++) {
+      if (buttonBar.members[i].buttonType) {
+        
OB.TestRegistry.register('org.openbravo.client.application.statusbar.button.' + 
buttonBar.members[i].buttonType + '.' + this.view.tabId, buttonBar.members[i]); 
       
+      }
+    }
     this.addMembers([this.leftBar, buttonBar]);
   },
   
diff -r 589b555e9f05 -r 8f802cc2e06e 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js
    Sat Jan 15 00:40:32 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js
    Sat Jan 15 09:00:19 2011 +0100
@@ -31,14 +31,14 @@
     },
     disabled: true,
     buttonType: 'save',
-    prompt: OB.I18N.getLabel('OBUIAPP_SaveRow')  
+    prompt: OB.I18N.getLabel('OBUIAPP_SaveRow')
   },
   NEW_BUTTON_PROPERTIES: {
     action: function(){
       this.view.newRow();
     },
     buttonType: 'newRow',
-    prompt: OB.I18N.getLabel('OBUIAPP_NewRow')  
+    prompt: OB.I18N.getLabel('OBUIAPP_NewRow')
   },
   DELETE_BUTTON_PROPERTIES: {
     action: function(){
@@ -46,7 +46,7 @@
     },
     disabled: true,
     buttonType: 'eliminate',
-    prompt: OB.I18N.getLabel('OBUIAPP_DeleteRow')  
+    prompt: OB.I18N.getLabel('OBUIAPP_DeleteRow')
   },
   REFRESH_BUTTON_PROPERTIES: {
     action: function(){
@@ -54,7 +54,7 @@
     },
     disabled: false,
     buttonType: 'refresh',
-    prompt: OB.I18N.getLabel('OBUIAPP_RefreshData')  
+    prompt: OB.I18N.getLabel('OBUIAPP_RefreshData')
   },
   UNDO_BUTTON_PROPERTIES: {
     action: function(){
@@ -62,7 +62,7 @@
     },
     disabled: true,
     buttonType: 'undo',
-    prompt: OB.I18N.getLabel('OBUIAPP_UndoRow')  
+    prompt: OB.I18N.getLabel('OBUIAPP_UndoRow')
   }
 });
 
@@ -86,6 +86,8 @@
     if (this.leftMembers) {
       for (i = 0; i < this.leftMembers.length; i++) {
         newMembers[j] = this.leftMembers[i];
+        
OB.TestRegistry.register('org.openbravo.client.application.toolbar.button.' + 
this.leftMembers[i].buttonType + '.' + this.view.tabId, this.leftMembers[i]);
+        
         newMembers[j].toolBar = this;
         newMembers[j].view = this.view;
         j++;
@@ -111,6 +113,7 @@
     if (this.rightMembers) {
       for (i = 0; i < this.rightMembers.length; i++) {
         newMembers[j] = this.rightMembers[i];
+        
OB.TestRegistry.register('org.openbravo.client.application.toolbar.button.' + 
this.rightMembers[i].property + '.' + this.view.tabId, this.rightMembers[i]);
         newMembers[j].toolBar = this;
         newMembers[j].view = this.view;
         j++;
@@ -553,17 +556,17 @@
     }
     return;
   },
-
+  
   // ** {{{ refreshToolbarButtons }}} **
   //
   // Refreshes all buttons in the toolbar based on current record selection
   //
-  refreshToolbarButtons: function() {
+  refreshToolbarButtons: function(){
     var buttons = this.getRightMembers();
     var hideAllButtons = this.view.viewGrid.getSelectedRecords().length !== 1;
     
-    for (var i = 0; i < buttons.length; i++){
-      if (buttons[i].refresh){
+    for (var i = 0; i < buttons.length; i++) {
+      if (buttons[i].refresh) {
         buttons[i].refresh(this.view.getCurrentValues(), hideAllButtons);
       }
     }
@@ -595,13 +598,13 @@
   showHover: true,
   customState: '',
   showMenuButtonImage: false,
-
+  
   initWidget: function(){
     this.Super('initWidget', arguments);
     this.resetBaseStyle();
   },
   
-  resetBaseStyle: function() {
+  resetBaseStyle: function(){
     var isMenu = false, extraClass;
     if (this.menu !== null) {
       isMenu = true;
@@ -615,7 +618,7 @@
       this.iconWidth = 1;
       this.iconHeight = 1;
     }
-
+    
     this.setBaseStyle('OBToolbarIconButton_icon_' + this.buttonType + 
this.customState + extraClass + 'OBToolbarIconButton');
   }
 });
diff -r 589b555e9f05 -r 8f802cc2e06e 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Sat Jan 15 00:40:32 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Sat Jan 15 09:00:19 2011 +0100
@@ -27,12 +27,6 @@
   ARROW_DOWN_KEY_NAME: 'Arrow_Down'
 });
 
-/*
- * Todos: - edit button klik selects one record, deselects others, opens edit
- * view and refreshes child windows. - a grid which gets opened always selects
- * the first record - double click on a record does the same as the edit 
button -
- * single click opens bubble: edit in grid, use as filter, open on tab
- */
 // = OBViewGrid =
 // The OBViewGrid is the Openbravo specific subclass of the Smartclient
 // ListGrid.

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to