Opened 11 years ago

Closed 4 years ago

#8725 closed task (patchwelcome)

MappedTextBox: rethink filter() method

Reported by: bill Owned by:
Priority: high Milestone: 1.13
Component: Dijit - Form Version: 1.3.0b1
Keywords: Cc:
Blocked By: Blocking:

Description

Currently, for widgets that mixin MappedTextBox, the filter() method has two purposes

  • corrections on the displayed value, such as trimming whitespace
  • corrections to the hidden value, such as (for NumberTextBox) converting null to NaN

This makes the code confusing to understand, as well as requiring branching inside functions like NumberTextBox.filter based on the argument's data type (number or string).

Further, there's a potential issue when the hidden value and displayed value are both strings, in that a FilteringSelect (for example) with propercase=true might convert a key like "CA" into "Ca", which is not appropriate.

Anyway, for 2.0 should think about splitting filter() into two methods (maybe filter() and filterHiddenValue()), the latter of which is only used for MappedTextBox subclasses.

Change History (4)

comment:1 Changed 9 years ago by bill

Component: DijitDijit - Form
Owner: set to Douglas Hays

comment:2 Changed 6 years ago by Douglas Hays

Owner: Douglas Hays deleted
Status: newassigned

comment:3 Changed 6 years ago by Douglas Hays

Status: assignedopen

comment:4 Changed 4 years ago by dylan

Milestone: 2.01.12
Resolution: patchwelcome
Status: openclosed

Given that no one has shown interest in creating a patch in the past 5+ years, I'm closing this as patchwelcome.

Note: See TracTickets for help on using tickets.