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
Contributor
Posts: 15
Registered: ‎07-15-2013
My Device: Blackberry Z10
My Carrier: Verizon
Accepted Solution

Is it possible to have different text on the action menu than on the action bar?

I want to have text on the action menu such as "Start my meeting" and have a title on the tab of the action bar that just says "Meeting" since start my meeting is hard to fit. Is this possible?

 

Thanks once again.

Highlighted
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Is it possible to have different text on the action menu than on the action bar?

[ Edited ]

There is but it's not exactly pretty, you can hook into the ActionMenuVisualStateChanged signal and change the text on showing then hook into the signal again to replace on the way out.

 

[Edit] The reason I say it's not pretty is that with your example if any of the ActionItem is visible on the bar then the text will noticably change.

 


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

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Is it possible to have different text on the action menu than on the action bar?

The code...

 

Page {
    actions: [
        ActionItem {
            id: aiFirst
            ActionBar.placement: ActionBarPlacement.OnBar
            title: qsTr("First")
        },
        DeleteActionItem {
            
        }
    ]

    onActionMenuVisualStateChanged: {
        if (actionMenuVisualState == ActionMenuVisualState.AnimatingToVisibleFull) {
            aiFirst.title = qsTr("First and still the best")
        } else if (actionMenuVisualState == ActionMenuVisualState.AnimatingToHidden) {
            aiFirst.title = qsTr("First")    	    
        }
    }

    [ ... ]

}

 


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

Developer of stokLocker, Sympatico and Super Sentences.
Contributor
Posts: 15
Registered: ‎07-15-2013
My Device: Blackberry Z10
My Carrier: Verizon

Re: Is it possible to have different text on the action menu than on the action bar?

Thanks so much! It works like a charm. I only wish there was a way to do it before the animation as opposed to after the animation.