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
marioi
Posts: 42
Registered: ‎07-23-2013
My Device: Z10
My Carrier: Vodacom
Accepted Solution

Hide Menu definition button once page opened

cascades_navigation_app_menu_showing.png

 

Basically what I'm looking to do in QML is set the "visible" property for a menu button on top to "false" once it has been clicked and the new page opened. For eg. in the image above, once I've clicked on the "settings" button and the settings screen opens, if I drag down on that screen again, the "settings" button should not be displayed because I'm already in that page.

 

Thanks.

Please use plain text.
Developer
BBSJdev
Posts: 6,090
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Hide Menu definition button once page opened

The picture won't be approved for a while.

 

FYI, the guidelines suggest disabling rater than removing menu actions so as not to confuse the use. I agree with this others won't.

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
BBSJdev
Posts: 6,090
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Hide Menu definition button once page opened

Give the ActionItem an id then set enabled = false;

 

id.enabled = false;


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
marioi
Posts: 42
Registered: ‎07-23-2013
My Device: Z10
My Carrier: Vodacom

Re: Hide Menu definition button once page opened

That worked, thank you BBSJdev. I was trying to use the "visible" property, which was obviously incorrect.

Where do I enable it again when I click on the "< back" tab and leave the screen again? I assume I must find the "onaction" signal somewhere for the back button.

Thank you again.
Please use plain text.
Developer
marioi
Posts: 42
Registered: ‎07-23-2013
My Device: Z10
My Carrier: Vodacom

Re: Hide Menu definition button once page opened

[ Edited ]

I'm still struggling to find the correct signal to enable the menu item again.

 

Which signal is emmitted when the "< back" button is pressed on the tabbed pane (where the menu item has already been disable previously)?

Please use plain text.
Developer
BBSJdev
Posts: 6,090
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Hide Menu definition button once page opened

There are a few but probably using activePaneTransitionEnded or activeTabChanged would probably work for you...

http://developer.blackberry.com/native/reference/cascades/bb__cascades__tabbedpane.html#function-act...

If I've misinterpreted your use of the word 'tab' and you are in fact using a navigationPane as your use of the word 'back' might indicate then the signal to hook in to is popTransitionEnded or topChanged...

http://developer.blackberry.com/native/reference/cascades/bb__cascades__navigationpane.html#function...


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
Benecore
Posts: 540
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: Hide Menu definition button once page opened

Topic not solved, so i'll try answering :Tt2:

 

In my application I have a solution like this.

 

I have defined new property on my pages also on the settings page

property bool active: false

 I use TabbedPane, but Settings page i pushing to NavigationPane. So i just change the active property on this signals

onPopTransitionEnded:{
    page.active = false
}
onPushTransitionEnded:{
    page.active = true
}

 and then on the page

onActiveChanged:{
    if (active){
        myMenuButton.enabled = false
    }else{
        myMenuButton.enabled = true
    }
}

 Hope it helps and (sorry my English :Wacko:)



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Please use plain text.
Developer
marioi
Posts: 42
Registered: ‎07-23-2013
My Device: Z10
My Carrier: Vodacom

Re: Hide Menu definition button once page opened

[ Edited ]

Thanks very much for sharing your knowledge, much appreciated and of benefit to the community too. I didn't get a chance to respond here earlier. After a lot of playing round, I found the below property worked.

 

I did however read your posts and take guidance of them. As happens regularly, there's usually more than one solution. I hope this helps someone else too.

 

 

paneProperties: NavigationPaneProperties {
        backButton: ActionItem {
            title: "Back"

            onTriggered: {
                menu_help_top.enabled = true;  //enable the menu button again
                Qt.nav_pane.pop();
            }
        }
    } // end of NavigationPaneProperties

 :Clap:

Please use plain text.