Opened 12 years ago

Closed 12 years ago

Last modified 8 years ago

#5209 closed defect (fixed)

DateTextBox widget function setValue is not called onValueSelected event

Reported by: guest Owned by: Douglas Hays
Priority: high Milestone: 1.0.1
Component: Dijit - Form Version: 1.0
Keywords: DateTextBox Cc: prajwala@…
Blocked By: Blocking:

Description

DateTextBox? widget setValue function is not executing when the date from the popup calendar is changed. setValue is called on the onblur event handler.

I am trying to attach an event when the date from the widget is changed.

steps to reproduce the bug:

  1. click the textbox
  2. choose the date from the pop up calendar.
  3. the calendar is closed.
  4. value is updated in the textbox. but setValue (and attached event) are not called
  5. click anywhere on the screen. onBlur event is fired and the attached event.

Prajwala

Attachments (1)

TimeTextBox.patch (788 bytes) - added by guest 12 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 12 years ago by guest

I solved the issue calling setValue on onValueSelected event handler. And removing setValue from onBlur event handler. I am not sure about the impact of removing this from onBlur, but it is working fine for me :)

patch attached.

Prajwala

Changed 12 years ago by guest

Attachment: TimeTextBox.patch added

comment:2 Changed 12 years ago by bill

I don't understand why you don't just attach to onChange?

comment:3 Changed 12 years ago by guest

Hi Bill,

onChange is associated only with the "view" of the widget. I am manipulating DateTextBox? both in the html UI and programmatic (not triggered by user interaction in the DateTextBox? html element itself). I am using the setValue to change the DateTextBox? programmaticaly.

I want to attach an event whenever the value is changed, it doesnt matter if the change was done using the UI or not. I expected setValue to be THE function.

The problem in setting my handler both on setValue and onChange is that setValue is called onBlur event, so my attached function would be called twice for an UI interaction.

I also could solve my problem calling my attached event after every call I do to setValue, and attaching it to onChange. But I guess it is not a "clean" solution. ps. there is a problem in my patch. whenever I select a date on the popup calendar (and dont do anything to cause a onBlur on the DateTextBox?). If change the displayed window (alt-tab) when i come back to the browser the calendar pops-up again.

Prajwala & Eduardo

comment:4 Changed 12 years ago by bill

Milestone: 1.1
Owner: set to Douglas Hays

onChange() should be called whenever the value is changed by the user, or changed programatically, see [11475] and [11476]. (You need to upgrade to the 1.0.1 release as this change went in after 1.0) You might have to set intermediateChanges=true although I would hope that isn't necessary. Doug?

comment:5 Changed 12 years ago by guest

Thanks Bill. I didnt try with 1.0.1 yet but I know I will have another problem...

I want to attach different events to:

  1. changes made by the UI
  2. general changes (UI or programmatically)

I was using onChange and setValue respectively. If I am supposed to use onChange for general changes, what am I supposed to use on UI only modifications?

Prajwala & Eduardo

comment:6 Changed 12 years ago by bill

Milestone: 1.11.0.1
Resolution: fixed
Status: newclosed

Hmm, I don't know any easy way to do that, I think you are on your own if you want to differentiate those two things.

comment:7 Changed 8 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.