Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#15949 closed defect (fixed)

[regression] dojox/form/Rating no longer stores value in hidden field, form submission is broken.

Reported by: Nick Fenwick Owned by: bill
Priority: undecided Milestone: 1.8.2
Component: DojoX Widgets Version: 1.8.0
Keywords: Cc:
Blocked By: Blocking:

Description

http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/form/tests/test_Rating.html

I've found that in 1.8.0 the Rating dijit no longer updates its hidden field. Go to that tests page, view any of the Rating dijits and note the hidden input field, click on the Rating to change its value, the hidden field does not update.

This worked in 1.7.3. I don't know how to link to an online version of that, but have verified it on my local machine. In 1.7.3 Rating.js had:

setAttribute: function(/*String*/key, /**/value){
		// summary: When calling setAttribute("value", 4), set the value and render the stars accordingly.
		this.set(key, value);

The this.set() call ended up defaulting to defaultNode = this.focusNode" and "map = defaultNode" and then setting value on map.. which ended up setting the latest value on the focusNode of Rating, the hidden input field.

1.8 doesn't do any of that dance, Rating.js uses this._set() to set the value which doesn't touch focusNode, so the hidden field never gets set.

A very naive patch might be:

[neek@uberneek dojo-release-1.8.0-src]$ diff dojox/form/Rating.js ~/src/dojo/dojo-release-1.8.0-src/dojox/form/Rating.js 
115,116d114
<                       // reflect the new value in our hidden field, for form submission.
<                       this.focusNode.value = val;

Change History (4)

comment:1 Changed 7 years ago by bill

Milestone: tbd1.8.2
Owner: changed from dante to bill
Status: newassigned
Summary: dojox/form/Rating no longer stores value in hidden field, form submission is broken.[regression] dojox/form/Rating no longer stores value in hidden field, form submission is broken.

Looks like I broke it in [29299], I'll fix.

comment:2 Changed 7 years ago by bill

PS: your "naive" patch looks like the right way to fix it.

comment:3 Changed 7 years ago by bill

Resolution: fixed
Status: assignedclosed

In [29895]:

Fix hidden field getting set with Rating's value, thanks neek, fixes #15949 on trunk !strict.

comment:4 Changed 7 years ago by bill

In [29896]:

Fix hidden field getting set with Rating's value, thanks neek, fixes #15949 on 1.8 branch !strict.

Note: See TracTickets for help on using tickets.