Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#17119 closed defect (invalid)

dijit.form.RangeBoundTextBox does not validate range

Reported by: Frederic Canteloup Owned by: Douglas Hays
Priority: undecided Milestone: tbd
Component: Dijit - Form Version: 1.8.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by Douglas Hays)

Hello, When using RangeBoundTextBox? as editor in sitepen dgrid, I noticed that the min/max range was not validated upon editing the value. After enquiring I noticed that the rangeCheck method had a bug : it invokes compare(primitive,constraints.min) and compare(primitive,constraints.max) from _FormWidgetMixin.js as opposed to invoking compare(primitive.length,constraints.min) and compare(primitive.length,constraints.max). Applying this fix solved my issue and editor started working as expected.

Thanks again for your wonderful toolkit. Frederic

Change History (3)

comment:1 Changed 9 years ago by Douglas Hays

Description: modified (diff)
Resolution: invalid
Status: newclosed

I'm confused by the description. "primitive" by default is type=number and compare compares 2 numbers based on min and max. number.length is undefined. If a widget is using this for nonnumeric values, then there should be a specialized compare method that does the .length value-add.

comment:2 Changed 9 years ago by Frederic Canteloup

thanks, I naively thought that RangeBoundTextBox? was for string purposes. Are you saying that there is no equivalent of RangeBoundTextBox? for strings and that I then need to resort to overriding compare when needing to apply range constraints on strings ? Thanks for your help. Frederic

comment:3 in reply to:  2 Changed 9 years ago by Douglas Hays

Yes, exactly. Replying to fcanteloup:

Note: See TracTickets for help on using tickets.