Opened 13 years ago

Closed 12 years ago

Last modified 10 years ago

#2244 closed defect (fixed)

Using <dojo:combobox>, 'name' attribute does not exist

Reported by: Clarke Brunsdon (clarke@… Owned by: Douglas Hays
Priority: high Milestone:
Component: Widgets Version: 0.4.1
Keywords: dojo: firefox name comboBox Cc:
Blocked By: Blocking:

Description

When using a comboBox with a tag of <dojo:combobox />, the form is not submitted with the proper name of the comboBox element. Instead of the proper POST variable with the name of the comboBox, 'undefined' and 'undefined_selected' are posted.

Combobox.js has

659     if (! this.name && source.name){ this.name = source.name; }

where source is the fragment of the DOM node.

Since this comboBox was constructed from the dojo:comboBox style, the fragment is empty, and the args have the attributes of the node.

In widget.js:

677  var localProperties = localProps || parser.parseProperties(frag[frag["ns"]+":"+stype]);

An example tag of:

 <dojo:comboBox mode="remote" maxListLength="15" autoComplete="true" dataUrl="/search/UserSearch/user/%{{searchString}}" id="userName" name="userName" widgetId="userName" />

will show the error. 'undefined' and 'undefined_selected' will be posted, and not 'userName' and 'userName_selected'.

My apologies for how poorly I am able to describe the problem. I'm reasonably unfamiliar with dojo and javascript, and if any clarification is needed, I am CrimsonKing? in #dojo.

A simple (but hackish) fix to the bug would be to change comboBox.js to:

658    if (! this.name && source.name){ this.name = source.name; }
659    else if (args.name) { this.name = args.name; }

Change History (3)

comment:1 Changed 13 years ago by Douglas Hays

Owner: changed from bill to Douglas Hays

comment:2 Changed 12 years ago by haysmark@…

As you can see, I set some random states in the AutoCompleter? test and here is what I got:

state=Arkansas&foo.bar=New+York&foo.bar=Nevada&foo.bar=Nebraska&foo.bar=Arkansas&prog=Vermont

comment:3 Changed 12 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [8352]) Port of ComboBox?(=AutoCompleter?) and Select widgets to 0.9 dojo by haysmark@…. Fixes #2189, #1504, #1451, #2244, #2384, #2070, #899, #912, #1267, #1339, #1456, #1484, #1485, #2558, #1186

Note: See TracTickets for help on using tickets.