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
New Contributor
Posts: 3
Registered: ‎06-18-2011
My Device: Z10 STL-100-2
My Carrier: M1

Default backButton

Hi,

 

I have a page(navigationPane) that I need to show and remain till the user clicks a button on this page. on clicking the button, it navigates to another page. the problem is that I do not want the user to go back to that initial page, but the back button shows up and I can also swipe left to right to get to that initial page.

 

The second page has images that takes the user to a third page when the image is clicked..

 

I guess What I need to do is to disable the backButton on that second page, but not on the next pages as well as disable the left to right swipe on that second page only.

 

I have tried for days, but nothing seems to work.

 

Appreciate any help Please.

 

Thanks

Roland.

Developer
Posts: 180
Registered: ‎12-09-2011
My Device: 9360, BB10
My Carrier: Aircel

Re: Default backButton

use 

peekEnabled: false

to stop the changes of pages on swiping

 

and

backButtonVisible: false 

to remove the back button.

New Developer
Posts: 16
Registered: ‎05-14-2013
My Device: Z10 STL 100-2, Playbook wifi only
My Carrier: M1 - Singapore

Re: Default backButton

Thank you, will try that tomorrow. Hope this does not affect the page after that. 

 

Regards

Roland

Thank you
Regards
Roland
Developer
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30
My Carrier: T-Mobile

Re: Default backButton

To expand on what hermant_sain said and if I understand you correctly you have this scenario:

Page 1 -> Page 2 (no peak/back to Page1) -> Page X that can peak/back to Page 2

So when you set up Page 1 disable peek and back button (as explained by hermant_sain). Then when you push to Page 3, 4, 5, etc on the signal that pushes to those pages you can re enable peek and back so they work/appear. Finally have it so when they pop back to Page 2 it is disabled again. Hope that makes sense.
---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan
New Contributor
Posts: 3
Registered: ‎06-18-2011
My Device: Z10 STL-100-2
My Carrier: M1

Re: Default backButton

Thanks, That helped for the first part making peekEnabled and the back button enabled = false.

 

However I tried to place it to be equal to true on the second page and it kept on saying peekEnabled is an invalid symbol.

 ImageView {

                        // horizontalAlignment: HorizontalAlignment
                        //verticalAlignment: VerticalAlignment
                        // text: qsTr("Anterior ")
                        imageSource: "asset:///images/MyopiaControlMainMenu.jpeg"

                        gestureHandlers: [
                            TapHandler {
                                onTapped: {
                                    // show detail page when the button is clicked
                                    var page = getMyopiaControl();
                                    console.debug("pushing detail " + page)
                                    navigationPane.push(page);
                                }
                                property Page myopiaControl
                                function getMyopiaControl() {
                                    if (! myopiaControl) {
                                        myopiaControl = myopiaControlDefinition.createObject();
                                    }
                                    return myopiaControl;
                                }
                            }
                        ]
                        attachedObjects: [
                            ScrollView {

                            },

                            ComponentDefinition {
                                id: myopiaControlDefinition
                                source: "DetailsMyopiaControl.qml"
                            }
                        ]

 Where exactly do i place the code

 

Do I use navigationPane.peekEnabled:true?

 

Appreciate all Help please

 

 

Regards

Roland

Developer
Posts: 109
Registered: ‎08-23-2012
My Device: Blackberry Z10
My Carrier: TATA DOCOMO

Re: Default backButton

you need to put yourNavPaneID.peekEnabled = true
on which page you want swipe right page popping
put that code in onCreationCompleted like below

onCreationCompleted: {
yourNavPaneID.peekEnabled = true
}

once you change this property , it will retain its value untill you will not change its value again.

Dharmender Singh
New Developer
Posts: 16
Registered: ‎05-14-2013
My Device: Z10 STL 100-2, Playbook wifi only
My Carrier: M1 - Singapore

Re: Default backButton

Thanks, Yes, this solved the first problem. now when i go to second page, it will not peek, on the third page i used the peakEnabled=true so that i can peek into the second page. however i can now peak into the first page from the second.

 

Do I have to put in a peekEnabled = false when I pop the third page. I also cant get my pop to work even though I copy it from the tutorial. How do I code it and where do I put it?

 

I appologise, but I am new at this and am trying hard, but getting errors all the time.

 

Please Help

 

Regards

Roland

Thank you
Regards
Roland
Developer
Posts: 109
Registered: ‎08-23-2012
My Device: Blackberry Z10
My Carrier: TATA DOCOMO

Re: Default backButton

[ Edited ]

in you third page put the below code

paneProperties: NavigationPaneProperties {
backButton: ActionItem {
onTriggered: {
yourNavPaneID.peekEnabled = false
navPane.pop();
}
}
}

 

also put below code

 

onPeekEnded: {
yourNavPaneID.peekEnabled = false
}


Surely this will work for you.

Press like if this solve your problem?

Dharmender Singh
New Developer
Posts: 16
Registered: ‎05-14-2013
My Device: Z10 STL 100-2, Playbook wifi only
My Carrier: M1 - Singapore

Re: Default backButton

Thanks, It worked with the third page but messed up other pages. I'm sure I did not do something right in the other pages. 

 

I solved the problem by popping the 1st page off the stack.

 

Its working great now.

 

Thanks so much, this is a great place to come to when you need help. You guys have helped me a lot.

 

I have this application ready for iOS, but I am not going to release it to them as I really want to support BlackBerry.

 

Regards

 

Roland

 

 

Thank you
Regards
Roland
Developer
Posts: 109
Registered: ‎08-23-2012
My Device: Blackberry Z10
My Carrier: TATA DOCOMO

Re: Default backButton

If this solved your problem, plz accept as a solution.
Dharmender Singh