details:   /erp/devel/pi/rev/e00165a48492
changeset: 11624:e00165a48492
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Thu Apr 21 09:12:38 2011 +0200
summary:   Navbar now allows normal components instead of only 
BaseTemplateComponents

details:   /erp/devel/pi/rev/2a126e1629b3
changeset: 11625:2a126e1629b3
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Thu Apr 21 09:13:07 2011 +0200
summary:   Escape html shown in grid columns content

details:   /erp/devel/pi/rev/492b3bc4ab68
changeset: 11626:492b3bc4ab68
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Thu Apr 21 09:17:38 2011 +0200
summary:   Handle single clause at the top level criteria

details:   /erp/devel/pi/rev/8f3c92c9a858
changeset: 11627:8f3c92c9a858
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Thu Apr 21 09:20:01 2011 +0200
summary:   Solve focus issue in inline grid editing

details:   /erp/devel/pi/rev/85898bae3584
changeset: 11628:85898bae3584
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Thu Apr 21 09:21:14 2011 +0200
summary:   Upgraded to latest smartclient version 17 April 2011

details:   /erp/devel/pi/rev/4ebe6c3ab120
changeset: 11629:4ebe6c3ab120
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Thu Apr 21 09:22:01 2011 +0200
summary:   Prevent undefined error when opening datepicker

details:   /erp/devel/pi/rev/3161ff033994
changeset: 11630:3161ff033994
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Thu Apr 21 09:22:47 2011 +0200
summary:   Escape html shown in columns, prevent js undefined error

details:   /erp/devel/pi/rev/1abf8032d82a
changeset: 11631:1abf8032d82a
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Thu Apr 21 09:23:27 2011 +0200
summary:   Performance improvement in grid

diffstat:

 
modules/org.openbravo.client.application/src/org/openbravo/client/application/MainLayoutComponent.java
                                                       |     7 +-
 
modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-grid.js.ftl
                                                  |     1 +
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js
                                                      |     4 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-grid.js
                                                                  |     3 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
                                                             |    23 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
                                                             |   204 +-
 
modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/3.00/org.openbravo.client.application/ob-grid-styles.js
 |    11 +-
 
modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
                                                                  |     6 +-
 
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/isomorphic/ISC_Combined.js
                                       |  2362 ++++++---
 
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/isomorphic/ISC_History.js
                                        |    10 +-
 
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/openbravo/skins/3.00/smartclient/load_skin.js
                    |     9 +-
 
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/openbravo/skins/3.00/smartclient/skin_styles.css
                 |     5 +
 12 files changed, 1586 insertions(+), 1059 deletions(-)

diffs (truncated from 5795 to 300 lines):

diff -r ed461b7731e5 -r 1abf8032d82a 
modules/org.openbravo.client.application/src/org/openbravo/client/application/MainLayoutComponent.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/MainLayoutComponent.java
    Wed Apr 20 22:12:41 2011 +0200
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/MainLayoutComponent.java
    Thu Apr 21 09:23:27 2011 +0200
@@ -27,6 +27,7 @@
 import org.openbravo.base.session.SessionFactoryController;
 import org.openbravo.base.util.OBClassLoader;
 import org.openbravo.base.weld.WeldUtils;
+import org.openbravo.client.kernel.BaseComponent;
 import org.openbravo.client.kernel.BaseTemplateComponent;
 import org.openbravo.client.kernel.Template;
 import org.openbravo.dal.core.OBContext;
@@ -74,9 +75,11 @@
       try {
         final Class<BaseTemplateComponent> clz = 
(Class<BaseTemplateComponent>) OBClassLoader
             .getInstance().loadClass(nbc.getJavaClassName());
-        final BaseTemplateComponent component = weldUtils.getInstance(clz);
+        final BaseComponent component = weldUtils.getInstance(clz);
         component.setId(nbc.getId());
-        component.setComponentTemplate(nbc.getTemplate());
+        if (component instanceof BaseTemplateComponent && nbc.getTemplate() != 
null) {
+          ((BaseTemplateComponent) 
component).setComponentTemplate(nbc.getTemplate());
+        }
         component.setParameters(getParameters());
 
         jsCode = component.generate();
diff -r ed461b7731e5 -r 1abf8032d82a 
modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-grid.js.ftl
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-grid.js.ftl
       Wed Apr 20 22:12:41 2011 +0200
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-grid.js.ftl
       Thu Apr 21 09:23:27 2011 +0200
@@ -57,6 +57,7 @@
         ${field.filterEditorProperties}
         , title: '${field.title?js_string}'
         , prompt: '${field.title?js_string}'
+        , escapeHTML: true
         , showIf: '${field.initialShow?string}'
         , columnName: '${field.columnName?js_string}'
         , inpColumnName: '${field.inpColumnName?js_string}'
diff -r ed461b7731e5 -r 1abf8032d82a 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js
   Wed Apr 20 22:12:41 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js
   Thu Apr 21 09:23:27 2011 +0200
@@ -621,7 +621,9 @@
     this.Super('initWidget', arguments);
     
     // Force associated date text box to have the same enable status as the 
picker has
-    this.callingFormItem.disabled = this.disabled;
+    if (this.callingFormItem) {
+      this.callingFormItem.disabled = this.disabled;
+    }
   }  
 });
 
diff -r ed461b7731e5 -r 1abf8032d82a 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-grid.js
       Wed Apr 20 22:12:41 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-grid.js
       Thu Apr 21 09:23:27 2011 +0200
@@ -29,6 +29,7 @@
   poolComponentsPerColumn: true,
   showRecordComponents: true,
   canSelectText: true,
+  escapeHTML: true,
   
   createRecordComponent: function(record, colNum){
     var field = this.getField(colNum), rowNum = this.getRecordIndex(record);
@@ -166,7 +167,7 @@
         // which is maybe used somewhere else
         criteria = isc.clone(criteria);
         var internCriteria = criteria.criteria;
-        if (internCriteria) {
+        if (internCriteria && this.getEditForm()) {
           // now remove anything which is not a field
           // otherwise smartclient will keep track of them and send them again
           var fields = this.getEditForm().getFields();
diff -r ed461b7731e5 -r 1abf8032d82a 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Wed Apr 20 22:12:41 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Thu Apr 21 09:23:27 2011 +0200
@@ -990,19 +990,32 @@
   },
   
   focusInNextItem: function(currentItem) {
-    var chooseNextItem, i, nextItem, length = this.getItems().length;
+    var flds = (this.grid ? this.grid.getFields() : this.getFields);
+    var chooseNextItem, i, nextItem, length = flds.length;
     for (i = 0; i < length; i++) {
+      var item = this.getItem(flds[i].name);
+      if (!item) {
+        continue;
+      }
       // some items don't have a name, ignore those
-      if (chooseNextItem && this.getItems()[i].name && 
this.getItems()[i].isFocusable && this.getItems()[i].isFocusable()) {
-        nextItem = this.getItems()[i];
+      // !item.disabled because sometimes the whole form is disabled and needs 
to 
+      // be focused after enabling (after the fic call returns)
+      if (chooseNextItem && item.name && item.isFocusable && 
(item.isFocusable() || !item.disabled)) {
+        nextItem = item;
         break;
       }
-      if (this.getItems()[i].name === currentItem) {
+      if (item.name === currentItem) {
         chooseNextItem = true;
       }
     }
     if (nextItem) {
-      this.focusInItem(nextItem);
+      // in the fic call, all items are disabled, so let it be focused
+      // when returning
+      if (this.inFicCall) {
+        this.setFocusItem(nextItem);
+      } else {
+        this.focusInItem(nextItem);
+      }
     }
   },
   
diff -r ed461b7731e5 -r 1abf8032d82a 
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
  Wed Apr 20 22:12:41 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Thu Apr 21 09:23:27 2011 +0200
@@ -61,7 +61,7 @@
     canHide: false,
     showTitle: true,
     title: '&nbsp;',
-    autoFitWidth: true,
+    //autoFitWidth: true,
     canDragResize: false,
     canFilter: true,
     autoExpand: false,
@@ -72,6 +72,8 @@
     name: isc.OBViewGrid.EDIT_LINK_FIELD_NAME
   },
   
+  editLinkColNum: -1,
+  
   // ** {{{ dataPageSize }}} **
   // The data page size used for loading paged data from the server.
   dataPageSize: 100,
@@ -98,6 +100,7 @@
   canOpenRecordEditor: true,
   showDetailFields: true,
   showErrorIcons: false,
+  virtualScrolling: true,
   
   // internal sc grid property, see the ListGrid source code
   preserveEditsOnSetData: false,
@@ -116,13 +119,15 @@
 
   // commented out because of: https://issues.openbravo.com/view.php?id=16515
   // default is much smaller which give smoother scrolling
-//  quickDrawAheadRatio: 2.0,
-//  drawAheadRatio: 1.0,
-  scrollRedrawDelay: 20,
+//  quickDrawAheadRatio: 1.0,
+//  drawAheadRatio: 2.0,
+  // see this discussion:
+  // http://forums.smartclient.com/showthread.php?t=16376
+  scrollRedrawDelay: 0,
   // note: don't set drawAllMaxCells too high as it results in extra reads
   // of data, Smartclient will try to read until drawAllMaxCells has been
   // reached
-  drawAllMaxCells: 100,
+  drawAllMaxCells: 0,
   
   // keeps track if we are in objectSelectionMode or in toggleSelectionMode
   // objectSelectionMode = singleRecordSelection === true
@@ -131,7 +136,10 @@
   // editing props
   rowEndEditAction: 'next',
   listEndEditAction: 'next',
+  // disabled as it costs performance, but need to recheck
+  // if rows are drawn with multiple lines
   enforceVClipping: true,
+  canDragSelectText: true,
   validateByCell: true,
   
   currentEditColumnLayout: null,
@@ -142,6 +150,10 @@
   modalEditing: false,
   // set to true because if not all cols are drawn then when doing inline 
editing
   // errors were reported for undrawn columns
+  // need to rework how the FormInitializationComponent sets the valuemap and 
defaultvalue
+  // for non-existing columns this should be stored somewhere, see this reply 
in
+  // the smartclient forum:
+  // http://forums.smartclient.com/showthread.php?p=63146
   showAllColumns: true,
   //showGridSummary: true,
   
@@ -199,6 +211,8 @@
       localEditLinkField = isc.addProperties({}, this.editLinkFieldProperties);
       localEditLinkField.width = this.editLinkColumnWidth;
       this.fields.unshift(localEditLinkField);
+      // is the column after the checkbox field
+      this.editLinkColNum = 1;
     }
     
     this.editFormDefaults = isc.addProperties({}, OB.ViewFormProperties, 
this.editFormDefaults);
@@ -1225,11 +1239,7 @@
     if (this.isCheckboxField(field)) {
       // NOTE: code copied from super class
       var icon;
-      if (!this.body.canSelectRecord(record)) {
-        // record cannot be selected but we want the space allocated for the
-        // checkbox anyway.
-        icon = '[SKINIMG]/blank.gif';
-      } else if (this.singleRecordSelection && !this.allSelected) {
+      if (this.singleRecordSelection && !this.allSelected) {
         // always show the false image
         icon = (this.checkboxFieldFalseImage || this.booleanFalseImage);
       } else {
@@ -1757,13 +1767,11 @@
    },
   
   cellHasErrors: function(rowNum, fieldID){
-    var record = this.getRecord(rowNum);
-    var itemName;
     if (this.Super('cellHasErrors', arguments)) {
       return true;
     }
     if (this.getEditRow() === rowNum) {
-      itemName = this.getEditorName(rowNum, fieldID);
+      var itemName = this.getEditorName(rowNum, fieldID);
       
       if (this.getEditForm().hasFieldErrors(itemName)) {
         return true;
@@ -1877,49 +1885,34 @@
   // +++++++++++++++++ functions for the edit-link column +++++++++++++++++
   
   createRecordComponent: function(record, colNum){
-    var layout = this.Super('createRecordComponent', arguments), rowNum;
-    if (layout) {
-      return layout;
-    }
     if (this.isEditLinkColumn(colNum)) {
-      rowNum = this.getRecordIndex(record);
       layout = isc.OBGridButtonsComponent.create({
         record: record,
-        grid: this,
-        rowNum: rowNum
+        grid: this
       });
-      layout.editButton.setErrorState(this.rowHasErrors(rowNum));
+      
layout.editButton.setErrorState(record[isc.OBViewGrid.ERROR_MESSAGE_PROP]);
       
layout.editButton.setErrorMessage(record[isc.OBViewGrid.ERROR_MESSAGE_PROP]);
       layout.showEditOpen();
       record.editColumnLayout = layout;
+      return layout;
     }
-    return layout;
   },
   
   updateRecordComponent: function(record, colNum, component, recordChanged){
-    var superComponent = this.Super('updateRecordComponent', arguments);
-    if (superComponent) {
-      return superComponent;
+    // clear the previous record pointer
+    if (recordChanged && component.record.editColumnLayout === component) {
+      component.record.editColumnLayout = null;
     }
-    if (this.isEditLinkColumn(colNum)) {
-      // clear the previous record pointer
-      if (recordChanged && component.record.editColumnLayout === component) {
-        component.record.editColumnLayout = null;
-      }
-      component.record = record;
-      record.editColumnLayout = component;
-      component.rowNum = this.getRecordIndex(record);
-      component.editButton.setErrorState(this.rowHasErrors(component.rowNum));
-      
component.editButton.setErrorMessage(record[isc.OBViewGrid.ERROR_MESSAGE_PROP]);
-      component.showEditOpen();
-      return component;
-    }
-    return null;
+    component.record = record;
+    record.editColumnLayout = component;
+    
component.editButton.setErrorState(record[isc.OBViewGrid.ERROR_MESSAGE_PROP]);
+    
component.editButton.setErrorMessage(record[isc.OBViewGrid.ERROR_MESSAGE_PROP]);
+    component.showEditOpen();
+    return component;
   },
   
   isEditLinkColumn: function(colNum){
-    var fieldName = this.getFieldName(colNum);
-    return (fieldName === isc.OBViewGrid.EDIT_LINK_FIELD_NAME);
+    return this.editLinkColNum === colNum;
   },
   
   reorderField: function(fieldNum, moveToPosition){
@@ -1948,12 +1941,6 @@
   
 });
 
-// = OBGridToolStrip =
-// The component which is inside of OBGridButtonsComponent
-isc.ClassFactory.defineClass('OBGridToolStrip', isc.ToolStrip);
-
-isc.OBGridToolStrip.addProperties({});
-
 // = OBGridToolStripIcon =
 // The icons which are inside of OBGridToolStrip
 isc.ClassFactory.defineClass('OBGridToolStripIcon', isc.ImgButton);
@@ -1972,7 +1959,8 @@
 // The separator between icons of OBGridToolStrip
 isc.ClassFactory.defineClass('OBGridToolStripSeparator', isc.Img);
 
-isc.OBGridToolStripSeparator.addProperties({});

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to