Opened 12 years ago

Closed 12 years ago

Last modified 9 years ago

#4415 closed defect (fixed)

TimeTextBox clickableIncrement and visibleIncrement not working

Reported by: guest Owned by: haysmark
Priority: high Milestone: 1.1
Component: Dijit - Form Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

TimeTextBox?'s clickableIncrement and visibleIncrement attributes as described in http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/form-validation-specialized-input/textbox-validating-currency-number don't seem to have any effect. For example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>TextBox Demo</title>
    <style type="text/css">
        @import "http://o.aolcdn.com/dojo/0.9.0/dijit/themes/tundra/tundra.css";
        @import "http://o.aolcdn.com/dojo/0.9.0/dojo/dojo.css"
    </style>
    <script type="text/javascript" src="http://o.aolcdn.com/dojo/0.9.0/dojo/dojo.xd.js"
                djConfig="parseOnLoad: true"></script>
    <script type="text/javascript">
       dojo.require("dojo.parser");
       dojo.require("dijit.form.TimeTextBox");
    </script>
</head>
<body class="tundra">
        <input type="text" name="firstname" 
                dojoType="dijit.form.TimeTextBox"
                clickableIncrement="T00:30:00"
                visibleIncrement="T00:30:00"
                 />
</body>
</html>

Attachments (2)

4415.patch (10.3 KB) - added by haysmark 12 years ago.
Fixes #4415. TimePicker? copies clickableIncrement, visibleIncrement, and visibleRange through constraints on TimeTextBox?.
4415.2.patch (1.0 KB) - added by haysmark 12 years ago.
Fixes #4415. TimePicker? mixes in constraints from TimeTextBox?.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 12 years ago by haysmark

Owner: set to haysmark

Those are TimePicker? params I thought? I don't remember writing that for TimeTextBox?.

I suppose realistically we need a way for TimeTextBox? to tell its TimePicker? these things.

comment:2 Changed 12 years ago by bill

Milestone: 1.1

comment:3 Changed 12 years ago by guest

I dirtily fixed this in TimeTextBox?.js:

I added:

Dirty Fix trac#4415
clickableIncrement: "T00:15:00",
visibleIncrement: "T01:00:00",
visibleRange: "T05:00:00",
Dirty Fix trac#4415 end

after line 15 (simply declaring the variables).
And in function _open i added:

Dirty Fix trac#4415

clickableIncrement: this.clickableIncrement,
visibleIncrement: this.visibleIncrement,
visibleRange: this.visibleRange,

Dirty Fix trac#4415 end

after line 63 (telling the values to the timepicker).

Sorry for the bad style, but I'm a bit in a hurry. Please feel free to add this fix to dojo.

Best Regards

Matt

comment:4 Changed 12 years ago by haysmark

Yes we were really going to do just that but bill wants to wait for 1.1.

comment:5 Changed 12 years ago by Douglas Hays

Since DateTextBox? inherits from TimeTextBox? and doesn't want these attributes, I'd suggest that they be passed in via the constraints object, and then _TimePicker can copy these from contraints. Also, since _TimePicker is "internal", it might be good to just reference the values directly from constraints and just delete the old _TimePicker attributes.

Changed 12 years ago by haysmark

Attachment: 4415.patch added

Fixes #4415. TimePicker? copies clickableIncrement, visibleIncrement, and visibleRange through constraints on TimeTextBox?.

comment:6 Changed 12 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [12368]) Fixes #4415. Proxy commit for haysmark. Copy attributes from constraints in _TimePicker.js.

comment:7 Changed 12 years ago by haysmark

Updated the book page linked above.

Changed 12 years ago by haysmark

Attachment: 4415.2.patch added

Fixes #4415. TimePicker? mixes in constraints from TimeTextBox?.

comment:8 Changed 12 years ago by Adam Peller

(In [12370]) Use more concise mixin. Proxy commit for haysmark. Refs #4415.

comment:9 Changed 12 years ago by Adam Peller

(In [12372]) remove comment. dates match parsing scheme. Refs #4415.

comment:10 Changed 12 years ago by Adam Peller

(In [12505]) fix order of operations error in [12370]. Refs #4415

comment:11 Changed 9 years ago by bill

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