on 09-07-2006 7:00 AM
Hi,
I have a requirement that I need to display 5 Radiobuttons on output, when I select 1st Radiobutton it should show the message that "Button 1 is selected". like that if I select remaining Buttons they should display individually like 2,3,4,5 are selected.
I Need the coding and the steps from scratch to end.
Good answers are given excellent points.
Hi Manikandan,
First create a simple type in Dictionary. In the webDynpro structure go to [Dictionary -> Local Dictionary -> data Types -> Simple Types].
Create a simple type, with <b>Enumeration</b> from <i>Enumeration tab</i> values like 1,2,3,4,5 as per your requirement.
Now in create a attribute in context node (<i>Say: Selection</i>)and assign the type from the <b>Simple Type</b>. Select the package which you may have entered while creating the simple type and then finally bind this simple type with this attribute.
Now create a UI element [<b>RadioBUttonGroupByKey</b>], in the <b>SelectedKey</b> property of this UI element bind the attribute which you have now created.
Create a Action for this dropdown UI element. In this action you can write this code:
String selection = wdThis.wdGetContext().currentContextElement().getSelection();
if(selection.equalsIgnoreCase("1")){
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("Button 1 is selected");
}
else if(selection.equalsIgnoreCase("2")){
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("Button 2 is selected");
}
..
..
..
else if(selection.equalsIgnoreCase("5")){
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("Button 5 is selected");
}
I hope this will help you. For any further queries kindly revert back.
Regards
Pravesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
A few suggestions:
1. Never use all capital letters in either your posts or subject line. Using capital letters translates to shouting in the online world.
2. Refrain from using words like these:
<i> Good answers are given excellent points.</i>
SDN is a totally voluntary community and you are not entitled to get an answer. Words like these do not better your chances.
Let's all make SDN a better place.
Regards,
Satyajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this
Create Radiobutton Group by index And bind the value dynamically by
List radio = new ArrayList(); //define a List object
IPrivate<View>.I<Radio>node ele=wdContext.node<Radio>();
int num=1;
while(num<=5)
{
IPrivate<View>.I<Radio>Element ele=wdContext.create<Radio>Element();
ele.set<Param>(num);
radio.add(ele);
num++;
}
//add the list to radio node
wdContext.node<radio>().bind(radio);
you can receive the value of radio as
String radiovalue=wdContext.current<radio>Element().get<param>();
wdComponentAPI.getMessageManager().reportSuccess("Button"+ radiovalue + " is Selected");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.