Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12295 closed defect (fixed)

Select: _addOptionForItem() in dijit.form._FormSelectWidget uses wrong callback in store.loadItem()

Reported by: Adam Gould Owned by: Douglas Hays
Priority: high Milestone: 1.7
Component: Dijit - Form Version: 1.5
Keywords: Cc:
Blocked By: Blocking:

Description

When calling store.loadItem(), _addOptionForItem is passing an "onComplete" callback. This callback doesn't exist for loadItem(). It should be "onItem".

Attachments (1)

_FormSelectWidget.js.patch (763 bytes) - added by Adam Gould 9 years ago.
Patch against 1.5 to substitute the correct callback

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by Adam Gould

Attachment: _FormSelectWidget.js.patch added

Patch against 1.5 to substitute the correct callback

comment:1 Changed 9 years ago by bill

Component: GeneralDijit
Owner: changed from anonymous to Douglas Hays
Summary: _addOptionForItem() in dijit.form._FormSelectWidget uses wrong callback in store.loadItem()Select: _addOptionForItem() in dijit.form._FormSelectWidget uses wrong callback in store.loadItem()

Sounds like we are also missing a unit test for that method (or rather, the public API that uses that method).

comment:2 Changed 9 years ago by Douglas Hays

Milestone: tbd1.7

comment:3 Changed 9 years ago by bill

Component: DijitDijit - Form

comment:4 Changed 9 years ago by Douglas Hays

Clearly it should be onItem, but how do I trigger the if(!store.isItemLoaded(item)) code path in an automated test?

comment:5 Changed 9 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [24841]) Fixes #12295. Change onComplete to onItem as the attribute to loadItem. Needs an automated test but getting isItemLoaded to return false seems fleeting. !strict

comment:6 Changed 9 years ago by bill

You can see some examples where isItemLoaded(item) returns false in tests/tree/node1.1. It contains "partially loaded" items, ex::

{ $ref: 'node1.1.1', name: 'node1.1.1'}

(node1.1 is a data file for JsonRestStore, not ItemFileReadStore.)

Maybe it's not worth testing though, the idea of partially loaded items goes away with the new dojo.store API.

Note: See TracTickets for help on using tickets.