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
Highlighted
Developer
Posts: 64
Registered: ‎06-28-2011
My Device: BlackBerry Z10
My Carrier: Bell

Display different pages based on Selected Option

Is it possible to display a different page based on the option selected in a segmented control?

 

For example, if "data" is selected, display the data. If "picture" is selected, display the picture.

Retired
Posts: 54
Registered: ‎06-26-2012
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Display different pages based on Selected Option

Please use the selectedIndexChanged() signal i.e. inside the handler detect the selected option and push the appropriate page.

Developer
Posts: 64
Registered: ‎06-28-2011
My Device: BlackBerry Z10
My Carrier: Bell

Re: Display different pages based on Selected Option

So if I have: 

 

onSelectedOptionChanged: {
if (selectedOption = "info") {
info.createObject();
info.push();
}
}

 

and this is my ComponentDefinition 

ComponentDefinition {
id: info
Page {...

 

with my desired page's code following.

Retired
Posts: 54
Registered: ‎06-26-2012
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Display different pages based on Selected Option

Yes, this should work as well.