Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#2095 closed enhancement (fixed)

DropdownDatePicker: can't erase selected value

Reported by: bill Owned by: tk
Priority: high Milestone: 0.9
Component: Widgets Version: 0.4
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

If you erase the value from the <input> box (by backspacing), you would think there was no value selected, but when you press the drop down button the previously selected day is still shown.

Bring up test_DropdownDatePicker.html, erase the 10/31/2006 from the first <input> box, and show the drop down. 10/31/2006 is still highlighte4d. Compare to the "US format, empty" DDDP. If you show that drop down, nothing is highlighted.

Change History (8)

comment:1 Changed 13 years ago by Adam Peller

I assume we're talking DropdownDatePicker? here? Well, you are emptying the value and if you submit the form, you will get an empty value. The datepicker in the dropdown just happens to retain the context of the last time it was dropped down. What context should it have instead?

A consistent and clear way to clear the value for dddp and ddtp would be welcome, and I'd love it if it didn't involve the word "any" :) A language neutral mechanism is even better.

comment:2 Changed 13 years ago by Adam Peller

Type: defectenhancement

comment:3 Changed 13 years ago by bill

Description: modified (diff)
severity: normalminor
Summary: DatePicker: can't erase selected valueDropdownDatePicker: can't erase selected value

Oops, my bug description/title wasn't so good; updating to be more understandable.

comment:4 Changed 13 years ago by Morriz

Hi, I have the same problem. I don't wish to 'submit the form' as you suggest above, cause I mix dojo widgets with my own.

My scenario:

  • I erase the input box
  • I call the widgets getValue method
  • I get an old date?

I wish to receive a null or if I just erased the input box. I would assume that DatePicker? widgets have an onchange handler, so that gui changes get reflected in the value returned by .getValue().

I hope you agree :)

comment:5 Changed 13 years ago by tk

Owner: changed from Karl Tiedt to tk

Morriz,

your description of what you expect sounds legitimately how it should work... Updating this to be assigned to the right username and figured I'd add my 2 cents in.

comment:6 Changed 12 years ago by dylan

Milestone: 0.9

comment:7 Changed 12 years ago by Karl Tiedt

Resolution: fixed
Status: newclosed

(In [7178]) fixes #2095 and fixes #2027 Added recognition for widget.setValue(""); to clear the value of DatePicker? and DropdownDatePicker?... this also allows for a user to clear the inputNode on DropdownDatePicker? and tab out of it to clear the value, however in order to programatically clear a DropdownDatePicker?'s value you *MUST* use setValue("", simply doing DropdownDatePicker?.inputNode.value = "" *WILL NOT* work.

I looked into deferring creation of the datePicker in dropdown as well, but so many arbitrary functions rely on DatePicker? existing already that it will involve a significant rewrite of DropdownDatePicker?.js

comment:8 Changed 12 years ago by Karl Tiedt

Resolution: fixed

(In [7305]) references [7178] changeset on trunk fixes #2095 and fixes #2027

Note: See TracTickets for help on using tickets.