Opened 10 years ago

Closed 10 years ago

#8452 closed defect (duplicate)

[patch]dojox.form.DropDownSelect cannot be used with xhr forms

Reported by: Phil DeJarnett Owned by: Nathan Toone
Priority: high Milestone: 1.4
Component: DojoX Form Version: 1.2.3
Keywords: dojox DropDownSelect xhr form Cc:
Blocked By: Blocking:

Description

I really want to use DropDownSelect?, but because it wipes out the select element, and does not replace it at all, it cannot be used with standard xhr requests. I'm not sure if it even works for normal form submissions.

It should be modified to store the currently selected value in a hidden form element.

Attachments (3)

ddstest.htm (2.2 KB) - added by Phil DeJarnett 10 years ago.
Simplified test case to verify that xhr does not pick up the DropDownSelect? value.
DropDownSelect.js (783 bytes) - added by Phil DeJarnett 10 years ago.
Attaching sample subclass that handles submitting
DropDownSelect.html (1.2 KB) - added by Phil DeJarnett 10 years ago.
Attaching sample subclass that handles submitting (template)

Download all attachments as: .zip

Change History (13)

comment:1 Changed 10 years ago by dante

Owner: changed from dante to Nathan Toone

toonetown: is there something special about DDS that isn't allowing it to be picked up by formToJson for some reason?

a testcase would help.

comment:2 Changed 10 years ago by Phil DeJarnett

I simply added DDS to an existing form element, and tried submitting it using an xhrPost. Even looking at the XHR submission using FireBug? shows that the DropDownSelect? is ignored.

I'm attaching a fairly simple form. It requires server-side code to return the submitted values.

Changed 10 years ago by Phil DeJarnett

Attachment: ddstest.htm added

Simplified test case to verify that xhr does not pick up the DropDownSelect? value.

comment:3 Changed 10 years ago by Phil DeJarnett

Actually, DropDownSelect? doesn't appear to submit AT ALL. I tried the same code above, except I commented out the xhrPost method. The server did not see a value for the rating field there, either.

Changed 10 years ago by Phil DeJarnett

Attachment: DropDownSelect.js added

Attaching sample subclass that handles submitting

Changed 10 years ago by Phil DeJarnett

Attachment: DropDownSelect.html added

Attaching sample subclass that handles submitting (template)

comment:4 Changed 10 years ago by Phil DeJarnett

Finally, the last two attachments are for my subclass of DropDownSelect? that actually handles the form submission. I probably did it wrong, but it works. The main changes are:

  • Added a hidden (display:none) <input type="text"> with the correct name for the form.
  • Changed the name of the button to ${name}_button
  • Added methods to update the hidden textbox whenever the value is changed.

(Sorry about the rapid-fire posting - I didn't think to include this until later.)

comment:5 Changed 10 years ago by dante

you're fine - thanks for the test case and code. it should help. probably won't make 1.3, but definitely should work as expected.

comment:6 Changed 10 years ago by dante

Milestone: tbd1.4

comment:7 Changed 10 years ago by Nathan Toone

Have you submitted a CLA?

comment:8 Changed 10 years ago by Nathan Toone

Summary: dojox.form.DropDownSelect cannot be used with xhr forms[patch]dojox.form.DropDownSelect cannot be used with xhr forms

comment:9 Changed 10 years ago by Phil DeJarnett

What do you mean by a CLA?

comment:10 Changed 10 years ago by Nathan Toone

Resolution: duplicate
Status: newclosed

I believe this is actually covered by the first checkin around #7824

Note: See TracTickets for help on using tickets.