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

Java Development

Reply
New Developer
mobileberrit007
Posts: 20
Registered: ‎10-20-2008
My Device: Not Specified

radionbutton setchange listener

hi,

im a newbie

can any one give me a sample piece of code for the radio button setchangelistener?

 

i.e if i say 'Yes' i need to enable one textbox , if i say no i need to disable it

 

thanks

New Developer
mobileberrit007
Posts: 20
Registered: ‎10-20-2008
My Device: Not Specified

Re: radionbutton setchange listener

can anyone help me ?
Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: radionbutton setchange listener

a fieldchangelistener is independent from the type of field, just implement it.
lets say you have a method called switchTextField(boolean on) it looks like this:
public void fieldChanged(Field field, int context) {
switchTextField(radio1.isSelected());
}

be sure to have your radiobuttons in a radiobuttongroup
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter