Use this.name properly so widget in form behaves. #329
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.