黑莓级联中的json数组listview

Posted

技术标签:

【中文标题】黑莓级联中的json数组listview【英文标题】:json array listview in blackberry cascades 【发布时间】:2013-09-03 05:29:50 【问题描述】:

1.数组类型

"DATA":
[
"CategoryID":"3","CategoryName":"News","CountryID":"1","Result":"OK",
"CategoryID":"4","CategoryName":"Daily Paper","CountryID":"1","Result":"OK",
"CategoryID":"5","CategoryName":"Thanthi","CountryID":"1","Result":"OK",
"CategoryID":"1","CategoryName":"Newspaper","CountryID":"1","Result":"OK",
"CategoryID":"2","CategoryName":"Magazine","CountryID":"1","Result":"OK"
]


2.直接类型

[
"CategoryID":"3","CategoryName":"News","CountryID":"1","Result":"OK",
"CategoryID":"4","CategoryName":"Daily Paper","CountryID":"1","Result":"OK",
"CategoryID":"5","CategoryName":"Thanthi","CountryID":"1","Result":"OK",
"CategoryID":"1","CategoryName":"Newspaper","CountryID":"1","Result":"OK",
"CategoryID":"2","CategoryName":"Magazine","CountryID":"1","Result":"OK"
]

对于直接类型声明--->

 ListItemComponent 
     type: "listItem"
     StandardListItem 
         title: ListItemData.CategoryName
     
 

我的问题是如何为第一个 json 数组模型声明 title: ListItemData.???????

【问题讨论】:

【参考方案1】:

试试这个

ListItemComponent 
 type: "listItem"
 StandardListItem 
 title: ListItemData.DATA[0].CategoryName
 
 

【讨论】:

它对我不起作用。我什至尝试将listItem 更改为item 以及其他一些更改,但它们都没有奏效。它甚至不显示 ListView

以上是关于黑莓级联中的json数组listview的主要内容,如果未能解决你的问题,请参考以下文章

防止黑莓10级联中listview标题上的onTriggered事件?

如何从黑莓10级联中的复选框选定项目中获取值..?

在级联中解析 JSON

黑莓 / j2me 的 rpc 库 ( json / xml / * )

忽略级联中的输出

如何在级联中设置 UIPickerView