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
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 !