cancel
Showing results for 
Search instead for 
Did you mean: 

how to create radio button group dynamically

Former Member
0 Kudos

Hi,

I need to create radio button group by key from the values fetched from the oracle DB,i think you can do this by creating simple data type dynamically for the fetched values. can any one please guide me how to create simple data types dynamically.

is there any other solution to implement this?

Regards,

Lakshmi.

Accepted Solutions (1)

Accepted Solutions (1)

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi Lakshmi

Another solution would be to implement radio button group by values bind to a context node (key/value pairs). Then you do not need to change the simple type dynamically. Instead you just populate the context node bound to the group with key/value pairs fetched from DB.

Changing a simple type dynamically shall be used only if this is really necessary. I think here you can avoid doing this.

BR, Sergei

Former Member
0 Kudos

Hi,

Thanks a lot for your response.

Could you please let me know how to bind radio button group with Context node.

Regards,

Lakshmi.

siarhei_pisarenka3
Active Contributor
0 Kudos

Check this (RadioButtonGroupByIndex): http://help.sap.com/saphelp_nw70/helpdata/en/59/b2af840e67514f8e8973d97d494c9b/content.htm.

"The context must provide a context node X that can contain 0 to n elements (X.cardinality=0..n). The context node must contain a context attribute y that is of a simple type and provides the texts for the radio buttons. For data binding, property texts is bound to attribute y. Each node element represents a radio button. The selected index is specified by the lead selection of the node X."

BR, Sergei

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Expert

Edited by: sudhir kumar on Jul 15, 2009 11:25 AM

Former Member
0 Kudos

Hi Expert

Its basically localy i have done for locally .you have to adjuct accordingly..all code writtin in wdDoModify method..due to Wd Ui created on WdModify method..

I have created one context value node adn ahhttribute for storing data the dynamically.

please look at following code and use accordingly

My Node value=Month.

vallue attribute--MonthName

String monthNames[]={

"January", "February", "March", "April",

};

List monthLst = new ArrayList();

for (int i = 0; i < monthNames.length; ++i)

{

IPrivateCompView.IMonthsElement month =

wdContext.createMonthsElement();

month.setMonthName(monthNames<i>);

monthLst.add(month);

}

wdContext.nodeMonthsOfYear().bind(monthLst);

// Bind node to element list

wdContext.nodeRFC().bind(month);

IWDTransparentContainer container = (IWDTransparentContainer)view.getElement("RootUIElementContainer");

IWDRadioButtonGroupByIndex radiobtn = (IWDRadioButtonGroupByIndex) view.createElement(IWDRadioButtonGroupByIndex.class, "MyradioByIndex");

radiobtn.bindTexts ("Month.MonthName");

ontainer.addChild(radiobtn);

Thanks

Jati

Former Member
0 Kudos

Hi,

this thread solves your problem,

http://help.sap.com/saphelp_nw70/helpdata/en/95/93fe1e71a2e44691b1f041e67f71aa/content.htm

Regards,

Sunaina Reddy T