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
Developer
Posts: 174
Registered: ‎03-05-2009
My Device: Dev Alpha
My Carrier: -
Accepted Solution

onPushTransitionEnded to replicated onExposed (legacy BB OS event)

Hi,

 

I am trying to replicate the behavior of onExposed/onUiEngineAttached from BB OS (pre BB10) using the onPushTransitionEnded of NavigationPane. But the issue is that the event is on the container (NavigationPane) and not on the actual view/page (Page)...therefore when the page receives the event, i am unable to differentiate whenter this event should be handled or not ...

 

Code snippets:

 

NavigationPane:

function displayPage1(){
page1= page1Definition.createObject();            navPane.pushTransitionEnded.connect(page1.handleOnPushTransitionEnded);
}

function displayPage2(){
page2= page2Definition.createObject();      
}

 

Based on the above code snippet, when i can displayPage2(), page2 is created and displayed BUT this also trigger the 'handleOnPushTransitionEnded' slot in page1...

 

onPushTrnasitionEnded does come with a 'page' argument but its type is 'QVariant(bb::cascades::smileytongue:age*)' where 'this' is a javascript object...so i couldn't compare by type, address or by the attribute 'id'...

 

Anyone encountered and solved this issue before? Any input is appreciated!

Developer
Developer
Posts: 174
Registered: ‎03-05-2009
My Device: Dev Alpha
My Carrier: -

Re: onPushTransitionEnded to replicated onExposed (legacy BB OS event)

i have been able to bypass this issue by not delegating the signal to the page but instead use the event on the navigation pane:

 

NavigationPane {
onPopTransitionEnded: {
        console.log("[HomePage.NavigationPane] onPopTransitionEnded for page:" + page);
        if (page.objectName == 'page2') {
            page.stop();
        }
    }
}

 

So the difference is that...a page in itself is NOT able (limitation) to properly listen to onPushTransitionended events....instead this should be handled outside the page i.e in the NavigationPane

 

Well since this is QML and javascript, almost every property is accessible externally ... therefore this is good enough as a solution for me.