cancel
Showing results for 
Search instead for 
Did you mean: 

Radiobuttons select/deselect

Former Member
0 Kudos

Dear All,

I have created two radio buttons on the view but when I deploy the application I see both of them selected. CAn we do some setting so that only one of them is selected by deafult?

Regds,

Anup

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI Anup,

I hope you are using normal 'RadioButton' UI element.

The 'keyToSelect' property determines what the key of the corresponding radiobutton is and 'selectedKey' defines where to set the selected value. So, if you want to show two radio buttons, bind their 'KeyToselect' to two different attributs and populate the attributes with their key values. Now bound the 'selectedKey' of both the radio buttons to a same third attribute. If you want to set a radio button as selected, set the selectedKey attribute likewise:

wdContext.currentContextElement.set<attribute bound to 'selectedKey'>(<key set to the corresponding radiobutton>);

Hope this helps,

Best Regards,

Nibu.

Anup, a small reminder about the need to close your threads and assigning points. Even after all those reminders, all your questions are still open. Please take care to close them & award appropriate points.

Qouting Aswin from BI General form "Assigning point to the helpful answers is the way of saying thanks in SDN. you can assign points by clicking on the appropriate radio button displayed next to the answers for your question. yellow for 2, green for 6 points(2)and blue for 10 points and to close the question and marked as problem solved. closing the threads which has a solution will help the members to deal with open issues with out wasting time on problems which has a solution and also to the people who encounter the same problem in future"

()

Former Member
0 Kudos

Keep also in mind that this does not work on mobile BlackBerry (when rendered as WML). There is no way to have two single radiobuttons to toggle unless you use the radiobuttongroup controls. SAP is aware of this bug and shall come up with an OSS soon.

Answers (2)

Answers (2)

Former Member
0 Kudos

hi Anup,

In the radiobutton uielement you have two properties keytoselect and selectedjey.

bind both these properties to two value attributes say keysel and selkey.

now in the doinit() set the any value for selkey like

wdcontext.currentcontextelement().setSelkey("value");

after this when u exceute the radiobutton will be unselected.

Former Member
0 Kudos

Hi Anup,

The radio button is selected if the context attribute to which the selectedKey property is bound, contains the value of the key that belongs to this radio button. The key is specified by the keyToSelectproperty.

Regards, Anilkumar