details:   /erp/devel/pi/rev/85e53b4d0fb0
changeset: 10474:85e53b4d0fb0
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Wed Feb 09 12:40:06 2011 +0100
summary:   Fix SetDocumentNoHandler. Take into account that docTypeTarget and 
docType can be null.

details:   /erp/devel/pi/rev/c228888b1225
changeset: 10475:c228888b1225
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Wed Feb 09 16:01:38 2011 +0100
summary:   Refresh in form and grid view when is needed.

details:   /erp/devel/pi/rev/6fff697189e9
changeset: 10476:6fff697189e9
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Wed Feb 09 16:30:07 2011 +0100
summary:   Windows with a column of reference ImageBLOB will be shown in 
classic mode until the reference is implemented in 3.0 windows.

diffstat:

 
modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
           |  10 +++++++
 
modules/org.openbravo.client.application/src/org/openbravo/client/application/event/SetDocumentNoHandler.java
 |   7 +++--
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
          |  13 ++++-----
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
              |   4 +++
 4 files changed, 24 insertions(+), 10 deletions(-)

diffs (83 lines):

diff -r 0bea82161179 -r 6fff697189e9 
modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
       Wed Feb 09 16:26:09 2011 +0100
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
       Wed Feb 09 16:30:07 2011 +0100
@@ -49,6 +49,16 @@
 
   static boolean showWindowInClassicMode(Window window) {
     for (Tab tab : window.getADTabList()) {
+
+      // FIXME Remove this once ImageBLOB is implemented
+      // Currently, windows with ImageBLOB reference columns will be shown in 
classic mode
+      String tableName = tab.getTable().getDBTableName();
+      org.openbravo.base.model.Table table = 
ModelProvider.getInstance().getTable(tableName);
+      for (org.openbravo.base.model.Column col : table.getColumns()) {
+        if 
(col.getReference().getId().equals("4AA6C3BE9D3B4D84A3B80489505A23E5")) {
+          return true;
+        }
+      }
       if (tab.getSQLWhereClause() != null && tab.getHqlwhereclause() == null) {
         // There is a tab with a SQL whereclause, but without a defined HQL 
whereclause
         return true;
diff -r 0bea82161179 -r 6fff697189e9 
modules/org.openbravo.client.application/src/org/openbravo/client/application/event/SetDocumentNoHandler.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/SetDocumentNoHandler.java
     Wed Feb 09 16:26:09 2011 +0100
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/SetDocumentNoHandler.java
     Wed Feb 09 16:30:07 2011 +0100
@@ -68,9 +68,10 @@
 
       String documentNo = (String) event.getCurrentState(documentNoProperty);
       if (documentNo == null || documentNo.startsWith("<")) {
-        final DocumentType docTypeTarget = (DocumentType) event
-            .getCurrentState(docTypeTargetProperty);
-        final DocumentType docType = (DocumentType) 
event.getCurrentState(documentTypeProperty);
+        final DocumentType docTypeTarget = (docTypeTargetProperty == null ? 
null
+            : (DocumentType) event.getCurrentState(docTypeTargetProperty));
+        final DocumentType docType = (documentTypeProperty == null ? null : 
(DocumentType) event
+            .getCurrentState(documentTypeProperty));
         // use empty strings instead of null
         final String docTypeTargetId = docTypeTarget != null ? 
docTypeTarget.getId() : "";
         final String docTypeId = docType != null ? docType.getId() : "";
diff -r 0bea82161179 -r 6fff697189e9 
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
      Wed Feb 09 16:26:09 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
      Wed Feb 09 16:30:07 2011 +0100
@@ -1115,22 +1115,21 @@
     
     if (!this.isShowingForm) {
       this.messageBar.hide();
-      this.viewGrid.filterData(this.viewGrid.getCriteria(), refreshCallback);
+      this.viewGrid.targetRecordId = 
this.viewGrid.getSelectedRecord()[OB.Constants.ID];
+      this.viewGrid.invalidateCache();
     } else {
       var view = this;
       if (this.viewForm.hasChanged) {
         var callback = function(ok){
           if (ok) {
-            var criteria = [];
-            criteria[OB.Constants.ID] = 
view.viewGrid.getSelectedRecord()[OB.Constants.ID];
-            view.viewForm.fetchData(criteria, refreshCallback);
+            this.viewGrid.targetRecordId = 
this.viewGrid.getSelectedRecord()[OB.Constants.ID];
+            this.viewGrid.invalidateCache();
           }
         };
         isc.ask(OB.I18N.getLabel('OBUIAPP_ConfirmRefresh'), callback);
       } else {
-        var criteria = [];
-        criteria[OB.Constants.ID] = view.viewForm.getValue(OB.Constants.ID);
-        view.viewForm.fetchData(criteria, refreshCallback);
+        this.viewGrid.targetRecordId = 
this.viewGrid.getSelectedRecord()[OB.Constants.ID];
+        this.viewGrid.invalidateCache();
       }
     }
   },
diff -r 0bea82161179 -r 6fff697189e9 
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 Feb 09 16:26:09 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Wed Feb 09 16:30:07 2011 +0100
@@ -463,6 +463,10 @@
       if (this.view.standardWindow.directTabInfo) {
         this.view.openDirectChildTab();
       }
+      
+      if (this.view.isShowingForm) {
+       this.view.viewForm.editRecord(gridRecord);
+      }
     } else {
       // wait a bit longer til the body is drawn
       this.delayCall('delayedHandleTargetRecord', [startRow, endRow], 200, 
this);

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to