Opened 11 years ago

Closed 11 years ago

Last modified 8 years ago

#8516 closed defect (fixed)

InlineEditBox._resetValue for DateTextBox

Reported by: skaterkfbs Owned by: Douglas Hays
Priority: high Milestone: 1.3
Component: Dijit - Form Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:

Description

When a DateTextBox? is created, the _resetValue property comes from _FormValueWidget and is set the this.value. this.value is equal to a javascript date object and does not take into account if datePattern is passed to it. When the keyPress event is done, the save button will always become activated. Also, there is no call to the enableSave function in the _onKeyPress event for _InlineEditBox. If you need more info, contact me at skaterkfbs[at]gmail[dot]com.

Change History (5)

comment:1 Changed 11 years ago by bill

Milestone: 1.3tbd

I think we need a test case. You are describing what's happening internally but I don't understand what the bug is, ie. how the widget is not behaving correctly.

comment:2 in reply to:  1 Changed 11 years ago by skaterkfbs

Replying to bill:

I think we need a test case. You are describing what's happening internally but I don't understand what the bug is, ie. how the widget is not behaving correctly.

Ok, so if I have the following:

<span dojoType="dijit.InlineEditBox" editor="dijit.form.DateTextBox" title="Click to edit the date" style="width: 115px;" editorParams="{constraints: {datePattern: 'MM/dd/yyyy'}, required: true}" required="true" autoSave="false">01/27/2009</span>

When I click on the inline edit box, it should show me the date field and popup the calendar. Now if I select the date 01/27/2009, the save button will be disabled but hitting left on the arrow keys will enable the save button.

In dojo-release-1.2.3-src\dijit\InlineEditBox?.js at line 384

_this.saveButton.attr("disabled", _this.getValue() == _this.editWidget._resetValue);

_this.editWidget._resetValue contains a Date object where _this.getValue() is a formatted date string.

This same line is where there is no call to _this.enableSave() as seen at line 424

this.saveButton.attr("disabled", (this.getValue() == this.editWidget._resetValue) || !this.enableSave());

I'm not sure where the _resetValue should be overriden. Probably somewhere in _DateTimeTextBox.js

comment:3 Changed 11 years ago by Douglas Hays

Milestone: tbd1.3
Owner: set to Douglas Hays

comment:4 Changed 11 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [16499]) Fixes #8516. The InlineEditBox? _resetValue was being incorrectly set to the value instead of the displayedValue. Then when compared to the displayedValue in order to enable the Save button, it was always changed.

comment:5 Changed 8 years ago by bill

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