Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12218 closed defect (fixed)

[patch][ccla] dojox.mobile.ScrollableView cannot be created dynamically

Reported by: zhangyp Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.6
Component: DojoX Mobile Version: 1.6.0b1
Keywords: Cc: Jared Jurkiewicz
Blocked By: Blocking:

Description

Current buildRendering logic in scrollable view assume that the scrollable view is created and initialized according to html template.

When we create scrollable view by var view = new dojox.mobile.ScrollableView?({id:"view"}); Line 41 of ScrollableView?.js for(i = 0, idx = 0, len = this.srcNodeRef.childNodes.length; i < len; i++){ will report error because this.srcNodeRef is null

Digging into this issue, I found other problems when creating scrollable view dynamically. For example, at Line 61 of ScrollableView?.js for(i = 0, len = this.domNode.parentNode.childNodes.length; i < len; i++){ this.domNode.parentNode is undefined when creating dynamically. After creating the view, if we call addChild to add footer or header, it will be added to containerNode instead of the domNode which is the expected node according to buildRendering logic. (I guess there should be specific methods to add footer and header in scrollable view)

All these problems lead to one question, do we support to create scrollable view dynamically? If not, we need to document the reason (For example, fast initialization or etc. ) and notify the users about the expected way to use it.

Attachments (1)

12218.patch (11.1 KB) - added by Douglas Hays 8 years ago.
Patch from Yoshiroh Kamiyama (IBM, CCLA)

Download all attachments as: .zip

Change History (9)

comment:1 Changed 8 years ago by bill

Component: GeneralDojoX Mobile
Owner: changed from anonymous to Shane O'Sullivan

comment:2 Changed 8 years ago by ykami

I'll take a look.

comment:3 Changed 8 years ago by ykami

zhangyp was correct. srcNodeRef should not be referenced, and addChild should be implemented to support fixed bars. Things were actually a little more complex because there are two types of fixed bars, view local bars and application bars. I fixed those problems and added two sample code test_dynamic-ScrollableView-vh-vf.html and test_dynamic-ScrollableView-ah-af.html. The former is for view local bar example, the latter is for application bar example.

Changed 8 years ago by Douglas Hays

Attachment: 12218.patch added

Patch from Yoshiroh Kamiyama (IBM, CCLA)

comment:4 Changed 8 years ago by Douglas Hays

Summary: dojox.mobile.ScrollableView cannot be created dynamically[patch][ccla] dojox.mobile.ScrollableView cannot be created dynamically

patch verified by zhangyp

comment:5 Changed 8 years ago by Douglas Hays

Cc: Jared Jurkiewicz added

comment:6 Changed 8 years ago by Jared Jurkiewicz

Owner: changed from Shane O'Sullivan to Jared Jurkiewicz

comment:7 Changed 8 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [23722]) Adding in Kamiyama's patch for scrollable views. \!strict fixes #12218

comment:8 Changed 8 years ago by bill

Milestone: tbd1.6

bulk update: bugs fixed in past few months, presumably milestone is 1.6

Note: See TracTickets for help on using tickets.