dojo / dojox

Dojo 1 - extras library. Please submit bugs to https://bugs.dojotoolkit.org/
https://dojotoolkit.org/
Other
150 stars 231 forks source link

Use this.name properly so widget in form behaves. #329

Closed neekfenwick closed 2 years ago

neekfenwick commented 2 years ago

See Issue #307

Expected behaviour: A Rating widget with a 'name' attribute in a form that is posted to the server should pass its value using that 'name' parameter.

Actual behaviour: Rating widget with a 'name' attribute sets its radio inputs to have a rating- name, and the last one's name is then overwritten with the 'name' attribute (I presume this is a FormWidget or similar behaviour acting on focusNode). Thus not all radio inputs have the same 'name', so clicking on them doesn't trigger the normal 'change' events.

Reproduce the bug:

Note: The bug is not apparent on the old test_Rating.html page because it doesn't actually test the form behaviour of the Rating widget.

I've updated the widget to use this.name and respect its initial value if set, rather than always cooking up a random name and applying it to the star radio elements. I also updated the test_Rating.html page so it properly uses the form's value, and in my local env have proven that this actually posts the value in the expected form field.

linux-foundation-easycla[bot] commented 2 years ago

CLA Signed

The committers are authorized under a signed CLA.