#14567 closed defect (fixed)
dojox.mobile.parser handles arrays differently than dojo.parser
Reported by: | Javier Pedemonte | Owned by: | ykami |
---|---|---|---|
Priority: | high | Milestone: | 1.8 |
Component: | DojoX Mobile | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
dojo.parser expects array attributes in the form of "'A','B','C','D','E'"
, using split()
to generate the array.
On the other hand, dojox.mobile.parser expects array attrs in the form of "['A','B','C','D','E']"
, using fromJson()
to generate the array.
This leads to an issue when trying to load a SpinWheel. To see for yourself, edit the test_SpinWheel-custom.html file and replace "dojox.mobile.parser" with "dojo.parser". Load and you'll see that the some of the SpinWheelSlots are rendered incorrectly.
Change History (8)
comment:1 Changed 9 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 9 years ago by
Ah I see. Since it's declared as an array (ie, default value is []), I'd say that dojox.mobile.parser needs to be updated to work like dojo.parser.
If it was declared as null then JSON for the value would be appropriate.
comment:4 follow-up: 6 Changed 9 years ago by
Bill, I tried "'A','B','C','D','E'" using dojo.parser. But the resulted value seems to be ["'A'","'B'","'C'","'D'","'E'"]. (Looks like we need to give "A,B,C,D,E" to get our expected ['A','B','C','D','E']) Is it the expected behavior?
jhpedemonte, I recommend you specify like this:
data-dojo-props="labels:['A','B','C','D','E']"
Both parsers should handle it in the same way.
comment:5 Changed 9 years ago by
The problem isn't with which array format I'm using. The problem is that all the docs for SpinWheel? and SpinWheelSlot? show an array format for labels
that works with dojox.mobile.parser
but not with dojo.parser
.
ykami, if that is the answer, then that means you guys have to update the mobile documentation with the correct array format.
comment:6 Changed 9 years ago by
Replying to ykami:
Bill, I tried "'A','B','C','D','E'" using dojo.parser. But the resulted value seems to be ["'A'","'B'","'C'","'D'","'E'"]. (Looks like we need to give "A,B,C,D,E" to get our expected ['A','B','C','D','E']) Is it the expected behavior?
Yup, that's the expected behavior. All dojo.parser supports (outside of data-dojo-props) is arrays of simple strings (i.e. strings that don't contain commas).
comment:8 Changed 9 years ago by
Milestone: | tbd → 1.8 |
---|
Are you talking about the slotClasses and slotProps parameters?