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
Regular Contributor
AVPTI
Posts: 61
Registered: ‎06-28-2011
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.

Please use plain text.
BlackBerry Development Advisor (Retired)
kizkasen
Posts: 54
Registered: ‎06-26-2012
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.

Please use plain text.
Regular Contributor
AVPTI
Posts: 61
Registered: ‎06-28-2011
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.

Please use plain text.
BlackBerry Development Advisor (Retired)
kizkasen
Posts: 54
Registered: ‎06-26-2012
My Carrier: Bell

Re: Display different pages based on Selected Option

Yes, this should work as well.

Please use plain text.