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
Forums Advisor I
Posts: 501
Registered: ‎03-01-2013
My Device: BlackBerry Z10
Accepted Solution

Problem in placing button in action bar

Hey

I want to add a button on action bar and few more actions on antion menu. But the problem is the button will also appear in the action menu.

 

Here is the code:

 

     actions: [
            ActionItem {

                title: "Option1"

                onTriggered: {
                    var page1 = catalogue1.createObject();
                    navigational.push(page1);
                }
            },
            ActionItem {
                title: "Option2"

                onTriggered: {
                    var page2 = history.createObject();
                    navigational.push(page2);
                }
            },
     
            ActionItem
            {
                title: "button"
                ActionBar.placement: ActionBarPlacement.OnBar
                
                onTriggered:
                {
                    //do work here.
                }
                
            }
        ]

 

The button is appeared on the action bar as well as on the action menu.

 

Can anyone help me??

Developer
Posts: 16,984
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Problem in placing button in action bar

this is by design, onBar buttons will also appear a second time to give the user a complete overview.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Forums Advisor I
Posts: 501
Registered: ‎03-01-2013
My Device: BlackBerry Z10

Re: Problem in placing button in action bar

What if i don't want itfor the second time?

Isn't there any other way to do so?

Developer
Posts: 16,984
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Problem in placing button in action bar

no
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Forums Advisor I
Posts: 501
Registered: ‎03-01-2013
My Device: BlackBerry Z10

Re: Problem in placing button in action bar

Ok..

Then is it possible to place four action items along the four corners of the display screen?

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

Re: Problem in placing button in action bar

[ Edited ]

This is 'by design' and what users would expect, therefore I wouldn't recommend you change it.

 

Having said that however trapping the AnimatingToVisibleFull and/or VisibleFull signal on the menu then hiding or removing the action would be the way to go if you must.

 

http://developer.blackberry.com/cascades/reference/bb__cascades__actionmenuvisualstate.html

 

A byproduct of this of course is that it will dissapear from the bar as well (maybe making your app look a bit jittery).

 


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: Problem in placing button in action bar

One question per thread please, post your 4 corners question in another thread and close this one off if it's been answered.

 


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.
Forums Advisor I
Posts: 501
Registered: ‎03-01-2013
My Device: BlackBerry Z10

Re: Problem in placing button in action bar

Ok

Then can you please give me some sample. How do i add or remove the action from the action menu??

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

Re: Problem in placing button in action bar

@vaishali28

 

You're questions suggest you are just starting with Cascasdes asking for samples when you clearly haven't put in the time to look around to see what's already available is a bit off. Just a quick search in the documentation would teach you about the visible property or the removeAction function

 

Please read the documentation on ActionBars and look at the samples already available...

 

http://developer.blackberry.com/cascades/sampleapps/


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.
Forums Advisor I
Posts: 501
Registered: ‎03-01-2013
My Device: BlackBerry Z10

Re: Problem in placing button in action bar

Ok i will go through these samples first..

Anyways thanks for the reply..Smiley Happy