cancel
Showing results for 
Search instead for 
Did you mean: 

Radiobutton problem in webdynpro

Former Member
0 Kudos

Hi All,

I have a radio button in my view. I bind its " KeyToSelect" and "SelectedKey" properties to 2 boolean variables. But in the output screen initially it is not selected. If I select it once ,I am unable to deselect it. How to deselect it after selecting that radio button.

Thanks in advacne.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Bharath,

I have demonstrated a simple scenario which might clear the properties of the radio button.

These are the 3 preperties maily used in case of radiobutton.

KeyToSelect: Unique key which which this radio button will be identified while selection from a number of radiobutton.s

SelectedKey: This property is 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.

Assume you have 2 radio button RB1 and RB2

Properties of RB1

KeyToSelect: Key_1

SelectedKey: context attribute (Ctx_SelectedKey) type String

OnSelect: Action1

Properties of RB2

KeyToSelect: Key_2

SelectedKey: context attribute (Ctx_SelectedKey) type String

OnSelect: Action2

Note: selectedKey is binded to the same context as you want to consider them as a single group.

If you want to set that RB1 should be selected by default when the application is executed.

you can write this in wdDoInit()

wdContext.currentContextElement().setCtx_SelectedKey("Key_1");

Regards,

Murtuza

Former Member
0 Kudos

Hi Murtuza,

First of all thanks for your simple and wonderful info about Radio buttons .

But in my view I have only one radio button ,which I want to select or deselect according to my conditions. How to do that?

Thanks in advance.

Former Member
0 Kudos

If you have only one radio button, then why not using a CheckBox?

Armin

Former Member
0 Kudos

Hi Bharath,

If you have a single choice and that too you need to toggle then the better option would be checkbox as again using radio button would add some amount of coding for toggling its state. I would suggest to opt for checkbox.

Regards,

Murtuza

Former Member
0 Kudos

Hi Murtuza,

I should use radio button only(Not check Box) . So can you please tell me the coding needed for that.

Thanks.

Former Member
0 Kudos

Hi Bharath,

The OnSelect action of RB is only called when the radio button is not selected and you are selecting it but once it is selected and you click on it again it won't be triggerred.

To toggle for the button you need to handle it in a seperate action for different UI element. Thus the user has to click on a different button(for eg.) to deselect the selection of the radio button and can click again the RB for its selection. No user would like an application to behave in this way and thus I suggested you to go for Checkbox instead of RB in your case.

Regards,

Murtuza

Former Member
0 Kudos

Hi Murtuza,

Thank you very much.....,Now all my doubts are cleared.

Regards,

Bharath A.

Former Member
0 Kudos

Hi Murtuza,

I have NWDS installed in my system but I dont know whether it is a NWDS2004 or NWDS2004s . How do I know it?I mean how can I know about the version?

Former Member
0 Kudos

Bharat,

Please check this thread for finding out the version of your NWDS

Thanks!

Surya.

Former Member
0 Kudos

Hi Bharath,

I don't know whether this is the only way to find the version of NWDS or not but I find it by clicking on

Help-->About SAP Netweaver Developer Studio

If the version begins with <b>7.something</b> then it is 2004s and if it begins with <b>2.something</b> then it is 2004.

Regards,

Murtuza

Former Member
0 Kudos

Did you read the Javadoc?

Armin

Former Member
0 Kudos

Hi Armin..,

I dont know about Javadoc. What is it? How is it useful for me? Where can I find it?

Thanks.

Former Member
0 Kudos

Hi

OnSelect call an action

in that check if

wdContext.currentContextElement().getCurrentContextElement();

if it returns true

write

wdContext.currentContextElement().setCurrentContextElement()=true;

else set it to false;

Regards

Abhijith YS