Openbravo Issue Tracking System - Retail Modules
View Issue Details
0029328Retail ModulesWeb POSpublic2014-12-11 18:062015-04-13 18:40
aaroncalero 
aaroncalero 
lowminorhave not tried
closedfixed 
5
pi 
RR15Q1.3RR15Q1.3 
adrianromero
No
0029328: Changing main window before callbacks are executed causes javascript errors
Changing the main window of the WebPOS (e.g. from #retail.pointofsale to #retail.cashup) before the initial window has finished loading (all callbacks have finished executing) causes javascript errors because the initial window is destroyed upon navigation. If there are pending callbacks that access window components (which have already been destroyed), errors similar to the following will be logged to the console:
posterminal.main.js: Uncaught TypeError: Cannot read property 'createComponent' of undefined;
Go to https://livebuilds.openbravo.com/retail_pi_pgsql/web/org.openbravo.retail.posterminal/?terminal=VBS-1 [^]
Log in with demouser/openbravo
As soon as the menu is available, switch to Cash Management or Cash Up windows.
Error messages will appear on the upper right corner of the screen and they will also be logged to the browser console.
Callbacks that execute asynchronously should check that the elements they are referencing still exist (objects that have been destroyed have a 'destroyed' attribute set to true).
Approved
related to defect 0029575 new marvintm Changing main window just after login causes a double navigation 
blocks defect 0028391 closed aaroncalero Changing main window before callbacks are executed causes javascript errors 
Issue History
2015-03-18 10:29malsasuaTypedefect => backport
2015-03-18 10:29malsasuaTarget Version => RR15Q1.2
2015-03-18 12:54dmitry_mezentsevTag Attached: Approved
2015-03-26 18:59malsasuaTarget VersionRR15Q1.2 => RR15Q1.3
2015-04-13 11:47OrekariaNote Added: 0076467
2015-04-13 11:47OrekariaStatusscheduled => resolved
2015-04-13 11:47OrekariaFixed in Version => RR15Q1.3
2015-04-13 11:47OrekariaResolutionopen => fixed
2015-04-13 16:40adrianromeroNote Added: 0076484
2015-04-13 16:48adrianromeroNote Deleted: 0076484
2015-04-13 16:51adrianromeroNote Added: 0076485
2015-04-13 17:06hgbotCheckin
2015-04-13 17:06hgbotNote Added: 0076492
2015-04-13 17:06hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/d7d844ee8a819805d1c870289b1d36ac2205cbe9 [^] => http://code.openbravo.com/retail/backports/3.0RR15Q1.3/org.openbravo.retail.posterminal/rev/b71c669fc94bf4adb1e24e8934397a47bca6c0b2 [^]
2015-04-13 18:40adrianromeroReview Assigned ToOrekaria => adrianromero
2015-04-13 18:40adrianromeroNote Added: 0076505
2015-04-13 18:40adrianromeroStatusresolved => closed
2015-04-13 18:40adrianromeroRelationship addedrelated to 0029575

Notes
(0076467)
Orekaria   
2015-04-13 11:47   
Repository: retail/backports/3.0RR15Q1.3/org.openbravo.mobile.core
Changeset: 4ae99dca0602336b10972fdd654a9931560292e1
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Wed Jan 07 10:01:29 2015 +0100
URL: http://code.openbravo.com/retail/backports/3.0RR15Q1.3/org.openbravo.mobile.core/rev/4ae99dca0602336b10972fdd654a9931560292e1 [^] [^]

Fixed issue 28391: Changing main window before callbacks are executed causes javascript errors

Added check to the callback that loads products to return inmediately if the component has already been destroyed.

---
M web/org.openbravo.mobile.core/source/retail/component/ob-retail-product-browser.js
---

Repository: retail/backports/3.0RR15Q1.3/org.openbravo.retail.posterminal
Changeset: 4c5e04e84b70af3d4446424761a65674093ff322
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Wed Jan 07 10:17:57 2015 +0100
URL: http://code.openbravo.com/retail/backports/3.0RR15Q1.3/org.openbravo.retail.posterminal/rev/4c5e04e84b70af3d4446424761a65674093ff322 [^] [^]

Fixed issue 28391: Changing main window before callbacks are executed causes javascript errors

Added check to the callback that loads sales representatives to return inmediately if the component has been destroyed

---
M web/org.openbravo.retail.posterminal/js/components/modalreceiptproperties.js
---

Repository: retail/backports/3.0RR15Q1.3/org.openbravo.retail.posterminal
Changeset: bc6741e586427eaef63e022cc753b789ec9f9e83
Author: Miguel A. Alsasua <miguel.alsasua <at> openbravo.com>
Date: Wed Mar 18 10:37:48 2015 +0100
URL: http://code.openbravo.com/retail/backports/3.0RR15Q1.3/org.openbravo.retail.posterminal/rev/bc6741e586427eaef63e022cc753b789ec9f9e83 [^] [^]

fixed issue 28391: added a line to check if the object has been destroyed when the callback is executed

---
(0076485)
adrianromero   
2015-04-13 16:51   
changeset: 1105:04113fd64d2f
user: Aaron Calero <aaron.calero@openbravo.com>
date: Mon Dec 15 13:51:22 2014 +0100
files: web/org.openbravo.mobile.core/source/component/ob-keyboard.js web/org.openbravo.mobile.core/source/retail/component/ob-retail-product-browser.js web/org.openbravo.mobile.core/source/retail/component/ob-retail-searchproductcharacteristic.js web/org.openbravo.mobile.core/source/retail/component/ob-retail-searchproducts.js
description:
Fixed issue 28391: Changing main window before callbacks are executed causes javascript errors

Fixed code in mobile core module. Added several checks to return inmediately if components have already been destroyed.
(0076492)
hgbot   
2015-04-13 17:06   
Repository: retail/backports/3.0RR15Q1.3/org.openbravo.retail.posterminal
Changeset: b71c669fc94bf4adb1e24e8934397a47bca6c0b2
Author: Miguel A. Alsasua <miguel.alsasua <at> openbravo.com>
Date: Wed Mar 18 10:37:48 2015 +0100
URL: http://code.openbravo.com/retail/backports/3.0RR15Q1.3/org.openbravo.retail.posterminal/rev/b71c669fc94bf4adb1e24e8934397a47bca6c0b2 [^]

Related to issue 28391, fixes issue 29328: Added a line to check if the object has been destroyed when the callback is executed

---
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/components/sharedcomponents.js
---
(0076505)
adrianromero   
2015-04-13 18:40   
Verified. But still exists a new issue related with the same action. See https://issues.openbravo.com/view.php?id=29575 [^]