Opened 14 years ago

Closed 13 years ago

Last modified 12 years ago

#564 closed enhancement (fixed)

[patch][need cla] regression: default value for combobox

Reported by: bill Owned by: bill
Priority: high Milestone:
Component: Widgets Version: 0.2
Keywords: ComboBox default Cc:
Blocked By: Blocking:

Description

Support default value for combobox, like this:

<select dojoType="combobox" value="red" style="width: 100px;" > ...

Change History (11)

comment:1 Changed 14 years ago by bill

Resolution: fixed
Status: newclosed

PS: Not sure what the right syntax would be. Standard html is like this:

<SELECT NAME="flavor">

<OPTION VALUE=a SELECTED>Vanilla <OPTION VALUE=b>Strawberry <OPTION VALUE=c>Rum and Raisin <OPTION VALUE=d>Peach and Orange

</SELECT>

but ComboBox? (in addition to the syntax above) can also get it's options list from a function.

I guess ComboBox? doesn't support the name/value pairs either...

comment:2 Changed 14 years ago by bill

Resolution: fixed
Status: closedreopened

comment:3 Changed 14 years ago by yml

Type: enhancementdefect

here it is a work around given on #dojo: I adapt it to the scenario given in the bug description. With the code below the default value will be red.

<select id="id_combo" dojoType="combobox" value="red" style="width: 100px;" >

<script type="text/javascript"> function myInit() {

dojo.widget.byId("id_combo").textInputNode.value = "red";

} dojo.addOnLoad(myInit); </script>

comment:4 Changed 14 years ago by alex

Resolution: fixed
Status: reopenedclosed

fixed in [3923]

comment:5 Changed 13 years ago by scudette@…

Keywords: ComboBox default added
Milestone: 0.3release0.4
Resolution: fixed
Status: closedreopened
Type: defectenhancement

This fix seems to have disappeared in the current version? Would be nice to be able to use:

<input dojoType="combobox" autocomplete="true" maxListLength="15" dataUrl="something.php" defaultValue="foo" />

This can be done by over riding the initialize method of dojo.widget.ComboBox?:

 defaultValue:'',
    
  initialize: function(args, frag) {
      dojo.widget.ComboBox.superclass.initialize.call(this, args, frag);

      if(this.defaultValue) {
	this.setValue(this.defaultValue);
      };
    },

comment:6 Changed 13 years ago by dylan

Summary: default value for combobox[patch] default value for combobox

comment:7 Changed 13 years ago by dylan

Summary: [patch] default value for combobox[patch][need cla] default value for combobox

Short fix, but no CLA on file, http://dojotoolkit.org/foundation/

comment:8 Changed 13 years ago by dylan

Summary: [patch][need cla] default value for combobox[patch][need cla] regression: default value for combobox
Type: enhancementdefect

comment:9 Changed 13 years ago by bill

(In [6200]) testcase for bug# 564 (references #564)

comment:10 Changed 13 years ago by bill

Resolution: fixed
Status: reopenedclosed
Type: defectenhancement

I just checked; it's working. The fix is [3923] and the test is [6200].

comment:11 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.