Openbravo Issue Tracking System - POS2
View Issue Details
0051758POS2Corepublic2023-03-02 12:022024-02-16 10:46
gorka_gil 
Triage Platform Base 
normalminoralways
newopen 
5
 
 
No
0051758: Cancel a value change in onFieldValueChange in a StandardStep don't prevent to visually display the new value
onFieldValueChange it is executed when any field of a form it is updated. This functions can be implemented to validate if a change of a form it is valid.

Using the form included in a StandardStep when cancelling the value change it correctly prevents to save the change in the processData, but visually shows the new value.

Since it is only visual, going to next step and returning to original step, the value remains the original one.
This can be seen in print product labels, go to step 2, and select a product. Go back to step1 and change the value of any field, it will show a popup , and if click cancel the change of value is canceled, but visually it is changed

Enter in pos2,
go to print labels (last entry in the left menu)
don't edit any field,
go to next step,
in selector category select any category like for example 'food'
select any product in the left list so it is added to the second list,
go back to step1,
edit any field, for example fixed quantity from 1 to 2 using the incremental button '+',
a popup it show asking for ensure continue and lost changes,
click on cancel

Error: the value on the field "fixed quatity" of step 1 has take the new value.

it is only visual, the context remain the correct value, and if navigating to step2 and going back to step1, the original good one it is displayed.
So it is only matter of visualization
No any proposed solution, but some ideas that we have think:

block the value change of the field before the onCahnge,

or execute a change to set the current original value, but we have tried and no look, plus if launched a change it will ask for confirmation again

or maybe create another event global for the entire form that allows to control the correct event, maybe the onChange event is not hte good one
No tags attached.
Issue History
2023-03-02 12:02gorka_gilNew Issue
2023-03-02 12:02gorka_gilAssigned To => Triage Platform Base
2023-03-02 12:02gorka_gilTriggers an Emergency Pack => No
2024-02-16 10:46gorka_gilSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=27531#r27531

There are no notes attached to this issue.