Versions: 1.3.89, 1.3.91, 1.4.0.1, 1.4.0.2, 1.4.0.3, 1.4.0.4, 1.4.0.5
Expected behavior: Regardless of the method used to submit the form, the data passed to the responding macro should be formatted the same, as determined by the action method value.
Observed behavior: When using a submit input type, the data for combo boxes is passed as expected. However, when using an image input type, the data for combo boxes passes the text of the option, rather than the value of the option.
Example:
Code: Select all
<select name="selectedItem">
<option value="none">The option is none.</option>
<option value="one">The option is one.</option>
<option value="many">The option is many.</option>
</select>
Code: Select all
{"selectedItem":"none","button":"Check Output"}
Data passed if input type is image:
Code: Select all
{"selectedItem":"The option is none.","button.value":"Check Output","button.x":"84","button.y":"25"}
The value of selectedItem should both be formatted as the submit input type does.
Additional Information:
This behavior is the same for all versions of the 1.4.0 series of releases, as well as 1.3.89 and 1.3.91
The same behavior occurs with a dialog or a frame.
Having only one button on the dialog (of either type) does not change the behaviors observed for that button type.
The value of selectedItem is the only input that is returned differently depending on what type of submission method is used. The buttons also function as expected, even when the combo box information is different.
Changing the action method to string properties rather than JSON produces the same results.
I have attached a token with some test macros to show the different outputs, in both JSON and strProps. Both the image button and the submit button call the same responder, which simple outputs the information. I have stripped it to the one case that is different, but it can be used to test any type of input.
I ran across this when I switched a button type on a dialog panel to make it prettier, and suddenly the switch statement in the responder stopped working, as the value being passed was changed.
I could not find anything in the code that jumped out and suggested why these two input methods would cause the combo box to be handled differently depending on the submission type, but I am not very experienced with Java, and so could be missing something obvious. On the other hand, it could be a swing problem doing something unexpected behind the scenes or something much more subtle in code. Thus I pass it to more capable hands.