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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Native Development

Reply
Regular Contributor
Megha_9_dec
Posts: 56
Registered: ‎08-21-2012
My Carrier: RIM

RadioButton side by side on BB10

[ Edited ]

Hi everyone, 

It's my application UI reqirement that the two Options of the RadioGroup shoud be placed side by side.

I did not find any way to place them horizontally.

 

So now I've found one work around for that..I'm placing two RadioGroups (having one one Options) side by side. following is the snippet.

 

 

RadioGroup {
id: group1
layoutProperties: AbsoluteLayoutProperties {
positionX: 100.0
positionY: 20.0
}
Option {
id: option1
 text: "Male"
onSelectedChanged: {
if (selected) {
option2.selected = false
}
}
}
}

 

 

RadioGroup {
id: group2
layoutProperties: AbsoluteLayoutProperties {
positionX: 200.0
positionY: 20.0
}
Option {
id: option2
text: "Female"
onSelectedChanged: {
if (selected) {
option1.selected = false
}
}
}
}

 

when I select the options turn by turn It works expectedly for first 4 attempts. after that both the options get selected.

 

Another issue with radio buttons is, I want my first Option of the RagioGroup to be selected initially. for that even if I have set selected property true of any Option, It shows me unselected.

 

 

Thanks.

Please use plain text.
BlackBerry Development Advisor
amarcon
Posts: 155
Registered: ‎07-16-2012
My Carrier: Bell

Re: RadioButton side by side on BB10

Hi,

 

regarding the layout, I would suggest to add them into a Container, StackLayout with LayoutDirection.RightToLeft, such as

 

Container {
        layout: StackLayout {
            layoutDirection: LayoutDirection.RightToLeft
        }

        RadioGroup { ....

        }

        RadioGroup { ....

        }

}

 

About your last comment, indeed it works for 4 attempts only, I've added some logs and it seems that it loses the Signal after that. I'll raise a bug for it and paste it here so you can vote on it, ok? It was a good catch.

 

Thanks.

Please use plain text.
BlackBerry Development Advisor
amarcon
Posts: 155
Registered: ‎07-16-2012
My Carrier: Bell

Re: RadioButton side by side on BB10

Hi,

 

Please vote for https://www.blackberry.com/jira/browse/BBTEN-230

 

Feel free to add any additional comments.

 

Thanks

Please use plain text.
Super Contributor
Meghasanghvi
Posts: 302
Registered: ‎08-10-2010

Re: RadioButton side by side on BB10

Ok, We vote for jira link you provided.

Please use plain text.