Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#692 closed defect (fixed)

[patch][cla] ComboBox form name missing

Reported by: cfranks@… Owned by: dylan
Priority: high Milestone:
Component: Widgets Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

When I create a ComboBox widget, the input field's name isn't being set for the submitted form.

This is the code I'm using to create the ComboBox:

<input class="dojo_autocomplete_textfield" id="widget_name" name="name" type="text" />
<script type="text/javascript">
	dojo.require("dojo.widget.*");
	dojo.require("dojo.widget.ComboBox");
	dojo.widget.createWidget(
		"ComboBox",
		{mode: "remote", 
		dataUrl: "dojo.pl?name_search=%{searchString}", 
		formInputName: "name"},
		dojo.byId("widget_name")
);

If I type 'foo' into the ComboBox, and submit the form, I get the values:

'' => 'foo'
'_selected' => 'foo'

Looking at the code for html/ComboBox.js, I can see that the variable "formInputName" is never used. It also doesn't seem to be successfully getting the name from the input tag attribute.

Also, is it really necessary for the ${name}_selected value to be sent in the form?

I'm running dojo svn version 3932

Attachments (1)

ComboBox.js.patch (759 bytes) - added by cfranks@… 13 years ago.
patch for src/widget/html/ComboBox.js

Download all attachments as: .zip

Change History (7)

Changed 13 years ago by cfranks@…

Attachment: ComboBox.js.patch added

patch for src/widget/html/ComboBox.js

comment:1 Changed 13 years ago by cfranks@…

Looking at the source, I've realised that I should have been passing the option "name" rather than "formInputName".

The patch I've just attached deals with 2 issues.

First it removes the reference to the "this.formInputName" value which is never used.

Secondly, if the "name" option isn't passed to the widget constructor, fillInTemplate instead tries to retreive the name from the source fragment.

comment:2 Changed 13 years ago by bill

Milestone: 0.4

comment:3 Changed 13 years ago by dylan

Owner: changed from anonymous to dylan
Status: newassigned

we need a CLA on file to accept patches. Can you fax or email one in so I can apply this patch?

comment:4 Changed 13 years ago by dylan

Summary: ComboBox form name missing[patch][cla] ComboBox form name missing

comment:5 Changed 13 years ago by dylan

Resolution: fixed
Status: assignedclosed

(In [5695]) fixes #692, ComboBox? form name missing, thanks for the patch

comment:6 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.