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
Posts: 56
Registered: ‎08-21-2012
My Device: BB10
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.

BlackBerry Development Advisor (Retired)
Posts: 155
Registered: ‎07-16-2012
My Device: Dev Alpha
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.

BlackBerry Development Advisor (Retired)
Posts: 155
Registered: ‎07-16-2012
My Device: Dev Alpha
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

Super Contributor
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified

Re: RadioButton side by side on BB10

Ok, We vote for jira link you provided.