Opened 14 years ago

Closed 14 years ago

#4050 closed defect (fixed)

inline autoSave filtering select - pressing Esc immediately closes box, should just revert

Reported by: ptbrunet Owned by: ptbrunet
Priority: high Milestone: 1.0
Component: Dijit Version: 0.9
Keywords: Cc: [email protected]
Blocked By: Blocking:

Description (last modified by ptbrunet)

I think this problem is related to the hierarchical design of a Filtering Select.

The problem is that in the inline test case when you open the filtering select widget and enter some text, pressing Esc immediately closes the box. The box should remain open and the value in the box should revert.

The problem is caused by the fact that the decision to keep the box open or closed is handled in the _onKeyPress handler of _FormWidget, but that logic never gets executed in the case of the DOM structure and handlers that exist in the case of the filtering select. Here is the structure:

span (widgetid=FilteringSelect)
..span (evt: _onKeyPress, point: editable, focusNode) <--- handler in InlineEditBox
..fieldset (point: editNode)
....div (evt: _onEditWidgetKeyPress, point: containerNode) <--- handler in InlineEditBox
......table (id=widget_setvaluetest, widgetid=setvaluetest)
..............input  (id=setvaluetest, point: textbox, focusNode, evt: onkeypress) <--- handler in ComboBoxMixin
..............div (point: downArrowNode)
....span (for the two buttons)

Note that there the handler in _FormWidget is not used in this case because of the hierarchy that exists in this situation. Here is the hierarchy:

FilteringSelect (derives from MappedTextBox and ComboBoxMixin; the parent hierarchies which are above this are shown below)

MappedTextBox (code resides in ValidationTextBox.js)

ComboBoxMixin (onkeypress is on input tag in ComboBox.html)

The keypress handler in _FormWidget is not called in this case. In other cases it is called as follows:

  1. TextBox - TextBox has no keypress handler but the one in _FormWidget is called via the dojo infrastructure because TextBox derives from _FormWidget
  2. TextArea - TextArea has a keypress handler and also calls the one in _FormWidget via this.inherited("_onKeyPress", arguments).

Those other scenarios work because the lowest level widget derives from _FormWidget, but in this case the keypress handler is set up in _DropDownTextBox which doesn't derive from _FormWidget.

Change History (5)

comment:1 Changed 14 years ago by bill

Milestone: 0.91.0
Owner: changed from bill to haysmark

comment:2 Changed 14 years ago by haysmark

Owner: changed from haysmark to ptbrunet

You can look into adding the _onKeyPress to the template. You might need to take the escape handler out of ComboBox? onkeypress for the two to get along.

comment:3 Changed 14 years ago by ptbrunet

Description: modified (diff)

comment:4 Changed 14 years ago by ptbrunet

Description: modified (diff)

comment:5 Changed 14 years ago by Becky Gibson

Resolution: fixed
Status: newclosed

(In [10383]) fixes #4050 commit for Pete Brunet (IBM CLA on file). Remove keypress handler from _DropDownTextBox as it isn't used. implementation of escape key to reset value in filtering select when press escape

Note: See TracTickets for help on using tickets.