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: 160
Registered: ‎01-27-2012
My Device: Playbook
My Carrier: Rogers
Accepted Solution

ActionBar.placement changes create duplicates

I want to create the functionality that if my app is purchased the action item will change from the InOverflow ot OnBar however the following code creates duplicte action items when it changes.  Any suggestions how to work around this?

 

            ActionItem {
                title: qsTr("Options")
                ActionBar.placement:  _tiledApp.purchased != "Purchased" ? ActionBarPlacement.OnBar : ActionBarPlacement.InOverflow
                onTriggered: {
                    if (_tiledApp.purchased == "Purchased") {
//                      if (purchased) {
                        var page = getOptionsPage();
                        console.debug("pushing detail " + page)
                        navPaneid.push(page);
                    } else {
                        optionsToast.show()
                        console.debug(purched);
                    }
                }
                attachedObjects: [
                    SystemToast {
                        id: optionsToast
                        body: "Premium version required"
                    }
                ]
            },

---
If you find my post helpful please "like" it and "accept as a solution"
Developer
Posts: 160
Registered: ‎01-27-2012
My Device: Playbook
My Carrier: Rogers

Re: ActionBar.placement changes create duplicates

I'll post this as bug - however leaving the actionitem in place and just changing the title, image and function is a workaround that works - just as long as you are swapping between onBar and inOverflow.

---
If you find my post helpful please "like" it and "accept as a solution"