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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 68
Registered: ‎03-18-2014
My Device: Z10
My Carrier: T-Mobile

Hub Integration / Close cards

Hi,

 

For my application I worked on integrating it into the Hub. I asked for the permissions, got them, and did most of the work. 

 

Now I am just having an issue with closing card which I open from the hub. I want the back button to be there, therefore the root node of my qmlDocument is a NavigationPane.

 

And In order to know when the card should be closed, I should listen to the 

onPopTransitionEnded event and close the card when triggered. 

 

However, In the example, I can see that:

- they create a root .qml which have a NavigationPane & an empty Page

- push the card you are interested into

- In the root qml, listen for the onPopTransitionEnded, and close the card.

 

_qml = QmlDocument::create("asset:///main.qml").parent(this);

_qml->setContextProperty("_app", this);

// Create root object for the UI
_root = _qml->createRootObject<NavigationPane>();

// Set created root object as the application scene
app->setScene(_root);


_pageQml = QmlDocument::create("asset:///message.qml").parent(this);

// Create root object for the UI
_page = _pageQml->createRootObject<Page>();

_root->push(_page);

 

 

 

But I don't like this, because if you want to go back half way, you can see the empty page and not the HUB... And if you go back completly, you see an empty page which close imediatly...

 

This looks really bad... 

 

 

 

So, what I did was to put as a root element the NavigationPane with the Page containing my card.

 

 

_qml = QmlDocument::create("asset:///message.qml").parent(this);

_qml->setContextProperty("_app", this);

// Create root object for the UI
_root = _qml->createRootObject<NavigationPane>();

// Set created root object as the application scene
app->setScene(_root);

 

 

But now, the onPopTransitionEnded is not triggered because when previous is selected, the page is gone...

 

Is there a solution to this? 

 

Thanks !