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
dtater
Posts: 158
Registered: ‎01-11-2010
My Device: 9700 | 9900 | PlayBook | Dev Alpha
My Carrier: Many :)

question about best way to impliment 'UI fragments'

Hello. 

 

Short version:  What is the Cascades equivelent of Android's ui fragment?

 

Long version:

 

Right now, I have an application with controll that is docked at the bottom, and a text label controll docked at the top.

 

In the middle i have a container which looks like this

 

MAIN.QML:

                // FRAGMENT container
                Container {
                    // we wrap the entire image here to align center horizontal
                    id: tab1_cont
                    layout: DockLayout {
                    }
                    layoutProperties: DockLayoutProperties {
                        horizontalAlignment: HorizontalAlignment.Center
                        verticalAlignment: VerticalAlignment.Center
                    }
                    
                    // insert the FMLight.qml object
                    FMLight {
                        
                        // FMLight is ABSOLUT layout, we need to put it in stack form, then center it.
                        layout: StackLayout {
                        }
                        layoutProperties: StackLayoutProperties {
                            horizontalAlignment: HorizontalAlignment.Center
                            verticalAlignment: VerticalAlignment.Fill
                        }
                        
                    } // end of FMLight object
                    
                    
                } // end of the tab1_cont container which holds our 'fragments'

 

And i have another QML file that i want to insert in *place* of the FMLight object.

 

What is the best way of doing this?  Should i just set the FMLight object visable to false?

 

 

Thanks for taking the time to read this!

- - - - - - - - - -
Please use plain text.
BlackBerry Development Advisor (Retired)
amarcon
Posts: 155
Registered: ‎07-16-2012
My Device: Dev Alpha
My Carrier: Bell

Re: question about best way to impliment 'UI fragments'

Hi dtater,

 

I think there is not something similar to Fragments available yet, but perhaps there are some possible alternatives such as setting the object visible like you mentioned.

 

Please, take a look at this

 

http://supportforums.blackberry.com/t5/Cascades-Development/Best-Practices-for-Switching-between-Vie...

 

http://supportforums.blackberry.com/t5/Cascades-Development/Extending-AbstractPane/m-p/1856431/highl...

 

Perhaps, if you make use of visible() like mentioned above, with tabbedPane such as the sample app weatherguesser available at https://github.com/blackberry/Cascades-Samples/tree/master/weatherguesser

 

Hope this helps,

 

Please use plain text.
BlackBerry Development Advisor (Retired)
amarcon
Posts: 155
Registered: ‎07-16-2012
My Device: Dev Alpha
My Carrier: Bell

Re: question about best way to impliment 'UI fragments'

Hi dtater,

 

I've found this Feature Request, https://www.blackberry.com/jira/browse/BBTEN-197

Please use plain text.
Developer
dtater
Posts: 158
Registered: ‎01-11-2010
My Device: 9700 | 9900 | PlayBook | Dev Alpha
My Carrier: Many :)

Re: question about best way to impliment 'UI fragments'

Thanks for the update; i'll vote for that ticket / issue!.

 

 

- - - - - - - - - -
Please use plain text.