點擊列表視圖按鈕時,我需要推送一個頁面。我嘗試了下面的代碼,但它不工作。如何導航到列表視圖中的另一個頁面按鈕點擊事件bb 10個級聯?
ListItemComponent {
type: "imageItem"
Container {
id: publicimageItem
......
......
ImageButton {
defaultImageSource: "asset:///defaultimg.png"
pressedImageSource: "asset:///pressedimg.png"
onClicked: {
var new_page = publicimageItem.ListItem.view.nextpage.createObject();
publicimageItem.ListItem.view.navigationPane.push(new_page);
}
attachedObjects: [
ComponentDefinition {
id: nextpage
source: "NextPage.qml"
}
]
}// ImageButton
}// Container
}// ListView
當我嘗試在列表視圖之外它將進入nextpage沒有任何問題。
首先,將代碼從這裏(http://developer.blackberry.com/cascades/download/releasenotes/#limitations)添加到main.cpp中,以便在控制檯中獲得輸出。當你想添加調試語句和顯示錯誤時,這非常有用。 – barry 2013-02-20 18:36:25
它也有助於測試/調試以在try..catch中包裝JavaScript代碼塊並將錯誤輸出到控制檯(如果您已實施上述Barry的建議)。通常,諸如「找不到對象」之類的錯誤不會輸出錯誤,而只是悄無聲息地失敗。 – hyarion 2013-02-21 10:02:18
你有沒有找到解決方案? – 2013-09-20 09:48:25