Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030808Openbravo ERPA. Platformpublic2015-09-09 18:292016-10-31 17:43
mfuertes 
platform 
normalminorhave not tried
closedopen 
5
 
3.0PR17Q1 
caristu
Core
No
0030808: Hook call twice in onChange function javascript
It seems that openbravo is calling the hook (the onchange function) twice when changing a select field in form view.
With developers tools in livebuilds add breakpoint in line 29514 (this line my change, search for: "if (view && OB.OnChangeRegistry.hasOnChange(view.tabId, item))")

When changing a select, chrome will reach that point twice.

(the client has a popup that is showing twice)
No tags attached.
has duplicate defect 0034200 closed alostale client side callouts are executed twice when picking a value in a selector drop down 
Issue History
2015-09-09 18:29mfuertesNew Issue
2015-09-09 18:29mfuertesAssigned To => platform
2015-09-09 18:29mfuertesModules => Core
2015-09-09 18:29mfuertesTriggers an Emergency Pack => No
2015-09-11 09:19alostaleNote Added: 0080328
2015-09-11 09:19alostaleAssigned Toplatform => mfuertes
2015-09-11 09:19alostaleStatusnew => feedback
2015-09-11 10:10mfuertesNote Added: 0080333
2015-09-14 12:46mfuertesStatusfeedback => new
2015-09-14 13:21mfuertesAssigned Tomfuertes => platform
2015-11-11 11:31alostaleStatusnew => acknowledged
2015-11-11 11:37alostalePriorityhigh => normal
2016-10-31 17:42caristuRelationship addedhas duplicate 0034200
2016-10-31 17:42caristuStatusacknowledged => scheduled
2016-10-31 17:43caristuReview Assigned To => caristu
2016-10-31 17:43caristuStatusscheduled => closed
2016-10-31 17:43caristuFixed in Version => 3.0PR17Q1

Notes
(0080328)
alostale   
2015-09-11 09:19   
Please, can you provide more detailed steps to reproduce based on a real case rather than on debugging the code?

What does "When changing a select" mean?
(0080333)
mfuertes   
2015-09-11 10:10   
Select as an html select, a field with a dropdown list in where you select an option.

For real code, take the tiquet from support. The client is having issues because has added a javascript in a field (Proveedor Preferencial) to trigger an event on field change, and it seems that its triggering the hook twice, as its diplaying the confirmation dialog twice. It only occcurs when the value on the field is changed, I mean, if you click and select the same value it only triggers it once.

So to reproduce it in livebuild I monitorized for a field (an html select field with onChange event like the one in the tiquet) the same exact part of the generated javascript code to see when the trigger is called, as I havent actully added javascript, and for a field change its reaching the "if" statement that decides whether to trigger the hook or not, twice.