Opened 11 years ago

Closed 8 years ago

Last modified 8 years ago

#8374 closed defect (fixed)

exception thrown when entering invalid value in an editable cell of a DataGrid

Reported by: goriol Owned by: Bryan Forbes
Priority: high Milestone: 1.7
Component: DojoX Grid Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:

Description

Context: A DataGrid? is created with one of its cells marked as editable. As that cell should only contain integers, the grid structure defines the field this way:

    ...
    {
      field: qty
      editable: true,
      type: dojox.grid.cells._Widget,
      widgetClass: dijit.form.NumberTextBox,
      constraint: { places: 0 }
    },
    ...

Scenario:

  • I double-click on the editable cell to change its value
  • I type an invalid value (for example "1.5", as I set up "places: 0" as a constraint)
  • I get a tooltip saying the value is not valid (this is the expected behavior).
  • I discard the message and press Enter to submit the value
  • An exception is thrown:
    [Exception... "'Error: assertion failed in ItemFileWriteStore' when calling method: [nsIDOMEventListener::handleEvent]" 
      nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "" data: no]
    

I was able to trace back this error up to ItemFileWriteStore._setValueOrValues() (which is called by the setValue() function). The exception is thrown at this line:

this._assert(typeof newValueOrValues !== "undefined");

I don't understand why this function is executed. As the value is invalid, the setValue() function should never be called, right?

Attachments (1)

essai.html (2.5 KB) - added by goriol 11 years ago.
test page

Download all attachments as: .zip

Change History (10)

Changed 11 years ago by goriol

Attachment: essai.html added

test page

comment:1 Changed 11 years ago by Bryan Forbes

Milestone: tbd1.3

comment:2 Changed 11 years ago by Bryan Forbes

Milestone: 1.31.4

The change for this will be very invasive because it will require figuring out a way to have validating widgets cancel an apply. Moving to 1.4.

comment:3 Changed 10 years ago by Nathan Toone

Milestone: 1.41.5

Moving non-regressions to 1.5

comment:4 Changed 9 years ago by bill

Milestone: 1.51.6

1.5 is released, moving remaining tickets to 1.6

comment:5 Changed 8 years ago by bill

Milestone: 1.6future

(sadly) punting seemingly abandoned ticket and meta tickets to future

comment:6 Changed 8 years ago by evan

Resolution: fixed
Status: newclosed

(In [25107]) Fixes #8374 not apply changes when there is validation error in the editing widget

comment:7 Changed 8 years ago by evan

Milestone: future1.7

comment:8 Changed 8 years ago by evan

(In [25235]) Refs #8374 backport fix to 1.6 branch

comment:9 Changed 8 years ago by evan

(In [25237]) Refs #8374 backport fix to 1.5 branch

Note: See TracTickets for help on using tickets.