details:   https://code.openbravo.com/erp/devel/pi/rev/b9dcfdaae170
changeset: 19847:b9dcfdaae170
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Mon Mar 04 12:52:56 2013 +0100
summary:   Fixes bug 22655, fixes bug 22851. Display logic works correct with 
one record.

When a record is clicked, it is selected and a call to the FIC is done in 
SETSESSION mode. This call returns with the form session variables. The problem 
is th
at when there is only one row in the grid, it is automatically selected and no 
call to the FIC is done in SETSESSION mode.

This was happening in this issue, so the button whose display logic used 
session variables was not working properly. Only when the grid was refreshed 
the call
to the FIC is SETSESSION mode was done.

This has been fixed by making a call to updateButtonState(false, false, true) 
when data is received from the dataset being returned only one row. This call 
wil
l result in a call to the fic in SETSESSION mode. The first argument ensures 
that the SETSESSION call is made, the second one is not used and the third one 
ens
ures that the call is made even if the view is being updated is not the active 
one.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
 |  9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diffs (26 lines):

diff -r 0c67d2f5ed69 -r b9dcfdaae170 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
     Mon Mar 04 12:27:07 2013 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
     Mon Mar 04 12:52:56 2013 +0100
@@ -1480,6 +1480,7 @@
   // mode is opened
   // - if there is only one record then select it directly
   dataArrived: function (startRow, endRow) {
+    var noSetSession, changeEvent, forceUpdate;
     // do this now, to replace the loading message
     // TODO: add dynamic part of readonly (via setWindowSettings: see issue 
17441)
     if (this.uiPattern === 'SR' || this.uiPattern === 'RO' || this.uiPattern 
=== 'ED') {
@@ -1543,6 +1544,14 @@
       // this select method prevents state changing if the record
       // was already selected
       this.doSelectSingleRecord(record);
+
+      // Call to updateButtonState to force a call to the FIC in setsession 
mode
+      // See issue https://issues.openbravo.com/view.php?id=22655
+      noSetSession = false;
+      changeEvent = false;
+      forceUpdate = true;
+      this.view.toolBar.updateButtonState(noSetSession, changeEvent, 
forceUpdate);
+
     } else if (this.lastSelectedRecord) {
       // if nothing was select, select the record again
       if (!this.getSelectedRecord()) {

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to