Ticket #692 (closed defect: fixed)

Opened 2 years ago

Last modified 15 months ago

[patch][cla] ComboBox form name missing

Reported by: cfranks@… Owned by: dylan
Priority: normal Milestone:
Component: Widgets Version: 0.3
Severity: normal Keywords:
Cc:

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

ComboBox.js.patch (0.7 kB) - added by cfranks@… 2 years ago.
patch for src/widget/html/ComboBox.js

Change History

Changed 2 years ago by cfranks@…

patch for src/widget/html/ComboBox.js

Changed 2 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.

Changed 2 years ago by bill

  • milestone set to 0.4

Changed 2 years ago by dylan

  • owner changed from anonymous to dylan
  • status changed from new to assigned

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

Changed 2 years ago by dylan

  • summary changed from ComboBox form name missing to [patch][cla] ComboBox form name missing

Changed 2 years ago by dylan

  • status changed from assigned to closed
  • resolution set to fixed

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

Changed 15 months ago by anonymous

  • milestone deleted

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.