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
Contributor
Posts: 26
Registered: ‎06-24-2013
My Device: Z10
My Carrier: Verizon
Accepted Solution

Injecting QML containers on the fly?

Hello, I'm quite new to Blackberry development, so far I can say I love it. I am working on an application that requires me to be able to change the QML that is inside of a container on the fly. For example:

 

        // MAIN CONTAINER PLACEHOLDER
        Container {
            id: mainContainer
            // Any way to inject fully built qml files right here, and swap them out on the fly?
        } 

 

I have a menu on the left hand side in the form of a ListView, when you tap a button at the top left, the current view moves to the right and allows you to use the navigation. When selecting a new navigation item, I want to replace what's in the "main container" with the appropriate QML file for what the user selected.

 

Thanks in advance for any help!

Developer
Posts: 84
Registered: ‎12-01-2012
My Device: 9790
My Carrier: Orange

Re: Injecting QML containers on the fly?

It should be possible. Just use functions add and remove, more details are in here: https://developer.blackberry.com/cascades/reference/bb__cascades__container.html

 

I would suggest to consider using dedicated Containers like NavigationPane, TabbedPane etc.

Lublin BlackBerry Developer Group


---
If I helped you please mark my response as solution or "Like" it.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Injecting QML containers on the fly?

You are better off using a control delegate for your given problem.

 

Take a look at the qml cascades cookbook sample to see how easy it is to do.

 

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.
Highlighted
Contributor
Posts: 26
Registered: ‎06-24-2013
My Device: Z10
My Carrier: Verizon

Re: Injecting QML containers on the fly?

[ Edited ]

Awesome, I did actually figure out a solution, but I feel like yours is much better. Thanks a lot!