cancel
Showing results for 
Search instead for 
Did you mean: 

RadioButton Deselect and lable

Former Member
0 Kudos

Hi All,

I have radiobuttongroupbykey UI element in my application.It is bind to valueattribute. I want to deselect radiobutton (reset radiobutton) on action Reset. How to reset radiobutton???

Also i dnt want to dispaly lable for radiobutton . If i set text blank thn key is getting displayed as label for radio button group. How to set lable as blank (No label ) for radiobuttongroup???

Ragards

Kavita

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kavita,

For your 1st Question....

Write this code on click of reset button ....

wdContext.currentContextElement().set<Your Context>(null);

This will definetly deselect your radio btn....

For your 2nd Question....

Can u brief me as in why u hv the requirement to set the label txt blank???

Regards,

Kunal Kotak

Former Member
0 Kudos

Hi Kunal ,

My deselecting radio button problem is solved .

About setting label as blank, I am creating quiz application where i have to display question text along with options. All UI are getting generated dynamically. I am displaying all questions on single page (no navigation from one question to another). So for every question label for options is getting repeated. I want to display label for all options at top of page as header , and on quiz page , along with questions only radio button should be displayed without labels.

Kavita

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Kavita,

Hope you are looking for radiobutton without label text.

ISimpleTypeModifiable myType=wdThis.wdGetAPI().getContext().getModifiableTypeOf("selectedRBKey");

IModifiableSimpleValueSet values=myType.getSVServices().getModifiableSimpleValueSet();

values.put("1"," "); // Empty string with space will remove your key from text

values.put("2","Fname");

values.put("3","Lname");

Regards, Suresh KB

Former Member
0 Kudos

Hi Suresh ,

Thnx for the solution , It resolved my problem. Thnx again

Kavita

Answers (2)

Answers (2)

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Kavitha,

In reset action do : wdContext.currentContextElement().setSelectedRBKey(""); //set null

Check the Label text string length if its zero means set the key as null.

Hope this will solve your problem

Regards, Suresh KB

Former Member
0 Kudos

Thnx .It solved my first problem .

About second problem , i m using radiobuttongroupbykey , so how can i set key as null???

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Kavita,

Try setting the label text as empty string " " and then check.

Regards, Suresh KB

Former Member
0 Kudos

Thnx Suresh for quick reply. I have tried your solution. But as label text is set blank String ("") , the value which is set as key for radiobuttongroupbykey is getting displayed as text.

Former Member
0 Kudos

Hi,

Use

Your Node is the node which is bound to the radio button group.

wdContext.node<YourNode>().setLeadselection(-1);

Regards

Ayyapparaj

Former Member
0 Kudos

But i am not using node , just attribute under root contextelement .