Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 783
Registered: ‎05-29-2012
My Device: see later
My Carrier: see later

Tabbedpane with navigatipane + actionitem

Tab {
        title:  qsTr("accounts") + Retranslate.onLocaleOrLanguageChanged
        id: accountsTab
        onTriggered: {
            alkhaliji.getAccount();
        }
        NavigationPane {
            id: accountsNavigationPane
            objectName: "accountsNavigationPane"
            onPopTransitionEnded: {
                page.destroy();
            }
           
        Page{
            id:accountTabPage
            content: AccountDetails {
            
            }
            attachedObjects: [
                ComponentDefinition {
                    id: accountDetails
                    source: "AccountDetailsSubPage.qml"
                },
                ComponentDefinition {
                    id: transacHistoryAccount
                    source: "TransactionHistoryAccount.qml"
                }
            ]
            actions: [
                
                ActionItem {
                    ActionBar.placement: ActionBarPlacement.InOverflow
                    title: qsTr("accountDetails") + Retranslate.onLocaleOrLanguageChanged
                    onTriggered: {
                        //accountTabPage.content = "AccountDetails.qml"
                        alkhaliji.getAccount();
                    }
                    imageSource: "asset:///images/ic_accounts_list.png"
                },ActionItem {
                    ActionBar.placement: ActionBarPlacement.InOverflow
                    title: qsTr("transactionHistory") + Retranslate.onLocaleOrLanguageChanged
                    onTriggered: {
                        alkhaliji.getAccount();
                    }
                    imageSource: "asset:///images/ic_history_list.png"
                }
                ]
        }
        } 

 

 

 

Simple what I want to do, I have a tabbedpane. Inside this particular tab I have 2 actionitem. When one actionitem is clicked i want to replace content  accountdetails, with a different content. when the other actionitem is clicked i want to replace the new content with accountdetails.

 

how can this be done?

Developer
Posts: 783
Registered: ‎05-29-2012
My Device: see later
My Carrier: see later

Re: Tabbedpane with navigatipane + actionitem

NavigationPane {
            id: accountsNavigationPane
            objectName: "accountsNavigationPane"
            onPopTransitionEnded: {
                page.destroy();
            }
           
            Page{
            id:accountTabPage
            content: AccountDetails {
                
            }
            attachedObjects: [
                ComponentDefinition {
                    id: accountDetails
                    source: "AccountDetailsSubPage.qml"
                }, ComponentDefinition {
                    id: accountDetsas
                    source: "AccountDetails.qml"
                }, ComponentDefinition {
                    id: transacHistoryAccount
                    source: "TransactionHistoryAccount.qml"
                }
            ]
            actions: [
                
                ActionItem {
                    ActionBar.placement: ActionBarPlacement.InOverflow
                    title: qsTr("accountDetails") + Retranslate.onLocaleOrLanguageChanged
                    onTriggered: {
                        //accountTabPage.content = "AccountDetails.qml"
                        // alkhaliji.getAccount();
                        accountTabPage.content = 
                        alkhaliji.getAccount();
                    }
                    imageSource: "asset:///images/ic_accounts_list.png"
                },ActionItem {
                    ActionBar.placement: ActionBarPlacement.InOverflow
                    title: qsTr("transactionHistory") + Retranslate.onLocaleOrLanguageChanged
                    onTriggered: {
                        //alkhaliji.getAccount();
                        var page = transacHistoryAccount.createObject();
                        accountsNavigationPane.pop();
                        accountsNavigationPane.push(page);
                    
                    }
                    imageSource: "asset:///images/ic_history_list.png"
                }
            ]

        }
            
        } 
       

 

 

how can I bold patt specify  different content?