Can I observe "saveEditorValues" to get an event when a DynamicForm (or ValuesManager) is correctly saved to the server? It seems to be working but is an undocumented feature AFAIK.
Announcement
Collapse
No announcement yet.
X
-
As a follow-up on my earlier question, the result is not satisfying. I have the following situation (please feel free to comment on the way of working in general).
I have a customer edit form. In it there is a grid with addresses [step 1]. If an address will be edited, a popup shows that allows an user to edit the address details [step 2]. If the form is submitted (either via a button click or pressing Enter), the address details are sent to the server for validation purposes only! On the server the values are checked and the validated record is returned (including extra fields!) [step 3].
In the addresses grid, I show an "address" field which is the combination of street and number. The "address" field cannot be edited in the popup, but the street and number can. When I validate on the server, I send back the validated record, including the (virtual) address field. When everything is okay, the grid gets updated.
At the moment I use observe() on the form's "saveEditorValues" but the record that gets passed to it (as first argument), doesn't contain the values as returned by the server [step 4]. I am aware of the "validationURL" functionality but - AFAIK - it submits the form after successful validation and this is not what I want. So that leaves me with the question: can I listen/observe an event/method with the validated record?
With 4 attached images I try to show what happens.
Comment
-
I opened this thread some months ago but now I'm facing a problem with it again. As soon as a form is saved AND the form's values are updated with the result from the server, I want to have an event fired.
I thought I have it working, by firing my own "onSaved" event from DynamicForm's SaveEditorValues' callback. I have another component listening to this event. In it I do form.getValues() and I don't see the updated values yet (when creating new records, the server autofills some fields and I want to use that autofilled value, but it's still undefined).
Any help would be appreciated, I hope my explanation is clear enough. ;-)
Comment
Comment