Opened 8 years ago
Closed 7 years ago
#17035 closed defect (invalid)
Model is not updated when form is submited by 'ENTER'
Reported by: | adros | Owned by: | Ed Chatelain |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | DojoX MVC | Version: | 1.9.0a2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
My typical scenario is that I have a dijit/form/Form bound to a model (Stateful) and on its submit event I want to do something with the model.
But the problem is that if I submit the form by pressing 'ENTER' while I am still focused on one of the form's field, the value from this field does not appear in the model (it was not synchronized yet, because sync is done on field's blur event which was not fired).
I have attached simple test case.
(My quick solution is to call _setBlurValue on focused field
var focusedNode = focus.curNode; if (focusedNode) { var focusedWidget = registry.getEnclosingWidget(focusedNode); if (focusedWidget && focusedWidget._setBlurValue) { focusedWidget._setBlurValue(); } }
Other option is to use intermediateChanges. But this is not the way I would like to go.)
Attachments (1)
Change History (3)
Changed 8 years ago by
Attachment: | sample.html added |
---|
comment:1 Changed 8 years ago by
comment:2 Changed 7 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
It is normal for some widgets not to save the value until focus leaves the field in those cases dojox/mvc will not be notified of a change because the widget does not set the value. So you will have to use one of the work arounds in those cases.
Some tests/samples deal with this by setting the focus to another field to force the update normally, with code like this: ddom.byId("modelArea").focus();