Skip to Content
author's profile photo Former Member
Former Member

How to know which radiobutton is selected in case of dynamic UI generation and how to pass it to back end?

This is how I have written for dynamically generating radiobuttons. I have some categories on left view, by selecting which, i will get corresponding questions and it generates 5 options, and user selects one and I need to pass it to back end. I am using IModifiableSimpleValueSet for filling the radiobuttons.

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

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

.

.

.

..

values.put(d,wdContext.nodeAns().getElementAt(d).getAttributeValue("option").toString());

Kindly help, if I am missing something.

IWDRadioButtonGroupByKey radioKey = (IWDRadioButtonGroupByKey)view.createElement(IWDRadioButtonGroupByKey.class, "ansRadio"+radio_count++);

IWDMatrixHeadData matrixHead_radio = (IWDMatrixHeadData)radioKey.createLayoutData(IWDMatrixHeadData.class);

IWDAction radioAction = wdThis.wdCreateAction(IPrivateRightView.WDActionEventHandler.SELECT_ANS, radioKey.getId());

wdComponentAPI.getMessageManager().reportSuccess("radio id"+radio_count);

radioKey.bindSelectedKey("Ans.option");

radioKey.mappingOfOnSelect().setString("optionID", radioKey.getSelectedKey());

wdContext.currentContextElement().setSel_ans(wdContext.currentAnsElement().getOption());

radioKey.setColCount(1);

questContainer.addChild(radioKey);

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Mar 05, 2015 at 05:00 PM

    why u have to dynamically generate radio button?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.