cancel
Showing results for 
Search instead for 
Did you mean: 

Radio Button GroupBy Key

Former Member
0 Kudos

I need help using the RadioButtonGroupBykey.

I am unable to use it in the application.

I have taken a radiobuttongroupbykey and used this code in initmethod,But i get error (500 Internal Server Error Failed to process request. Please contact your system administrator. ).

I have taken an attribute declared in context as selected key .

The following code wriiten in init Method

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

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

values.put("0","January");

values.put("1","February");

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

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

wdContext.currentContextElement().setRadio1("1");

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I dont think it is collecting any error stack for this application,

I tried to go through the application log t but couldnt trace anything except the deployment trace.

I have got this error in other application,but when I have made necessary corrections inthe application then I got the result ,But in radiop button I am unable to get the result.

and can you give me the code for init method to create a element and all the code related to a radio button.

Former Member
0 Kudos

Hi,

Here monthName is the context attribute

wdInit() code

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

// Set allowed values for this data type

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

values.put("0","January");

values.put("1","February");

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

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

values.put("4","May");

values.put("5","June");

values.put("6","July");

values.put("7","August");

wdContext.currentContextElement().setMonthName("1");

wdModifyView()

if (firstTime)

{

IWDRadioButtonGroupByKey radioButtonGroup =(IWDRadioButtonGroupByKey)

view.createElement(IWDRadioButtonGroupByKey.class, "MyRadioButtonGroupByKey");

radioButtonGroup.bindSelectedKey("monthName");

radioButtonGroup.setColCount(3);

IWDTransparentContainer container=(IWDTransparentContainer)

view.getElement("RootUIElementContainer");

container.addChild(radioButtonGroup);

}

regards,

Rajeev

Message was edited by: Rajeev Ranjan

Former Member
0 Kudos

Please don't propose doing all this stuff inside method wdDoModifyView().

Usually it is better to do as much as possible declaratively using the NWDS tools.

Armin

Former Member
0 Kudos

Hi ,

Armin:Thanks , U r right we should do it declaratively;

srivastsa : Instead of doing dynamically you can do it by adding RadioButtonGroupByKey UI element into ur view layout and mapping the conext attribute to the selected Key of the RadioButtonGroupByKey UI element

Regards,

Rajeev

Answers (4)

Answers (4)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Rajeev,

I did used the same code and declared an attribute of type string and used it in selected key and on event select I have given the action and other than these I dint disturb any properties of any page.I still get the same ERROR so Please ,If you have yahoo messenger and if you can come to chat I can be more clear, or can you tell me if you stay in USA I Can call you now.

Thanks

Former Member
0 Kudos

Hi srivastsa k ,

The code which you are using to populate Radio Button GroupBy Key is correct.The error is due to something else.

Regards,

Rajeev

Former Member
0 Kudos

Please post the complete stacktrace.

Armin