on 11-28-2007 5:39 AM
dear webdynpro developers
i need to know how to set a radio button to be clicked as default when i open a view.
Hi Rohan,
1. set the keyToSelect =key forradiobutton
2. Bind a context of type string to the selectedKey property of the radiobuttons name selectedradiobutton.
3. Create actions for all the buttons and bind them to their respective buttons.
4. In implementation you can check which radio button is selected using
if(wdContext.currentContextElement().getSelectedRB().equals("key_1"));
There are the 3 preperties maily used in of radiobutton.
KeyToSelect: Unique key which will be identified while selection from a number of radiobutton.s
SelectedKey: This is used set to the key of the radiobutton that is currently selected.
OnSelect: An event that you want to fire when the radio button is selected.
Rest each button is having a different action so you can open the document you want just checking which RB is selected.
if u want more information about Radio button go to this
https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/clientserver/uielib/standard/
Regards,
P.Manivannan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi manivanan,
yes what you are saying is to check wether it is clicked or not but i require the button to be set clicked when the view is opened for the first time.
for example i have 4 radio buttons where b is the default clicked
a b. c d
so when i open the view i can see that b is already selected
how do i code for this.
regards
Rohan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use this code
create 2 attributes
1.Radio_activity
2.Sel_Value
wdContext.currentContextElement().setRadio_activity("b");
wdContext.currentContextElement().setSel_value(wdContext.currentContextElement().getRadio_activity());
go to properties assign the value keytoSelect -
>SelValue
selectedKey--->RadioActivity
Regards,
P.Manivannan.
Dear Manoj
i created a simpetype of "People" with two values Male and Female.
I create one value attribute with the name "People".
When design time iam able to see the 3 radiobuttons.
at runtime i did not get any radiobutton.
i binded the selected key property with the People value attr.
Plz give me the sol
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.