Opened 9 years ago

Closed 8 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:


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) {

Other option is to use intermediateChanges. But this is not the way I would like to go.)

Attachments (1)

sample.html (1.4 KB) - added by adros 9 years ago.

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by adros

Attachment: sample.html added

comment:1 Changed 9 years ago by Ed Chatelain

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();

comment:2 Changed 8 years ago by Ed Chatelain

Resolution: invalid
Status: newclosed

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.

Note: See TracTickets for help on using tickets.