cancel
Showing results for 
Search instead for 
Did you mean: 

WD ABAP: How to use checkboxes in webdynpro for abap

Former Member
0 Kudos

Hello all,

I want to use a group of Radio-Buttons in my Webdynpro. If I use the element RadioButtonByKey it will shown three Radiobuttons, how can I use them? I think I have to bind every Radiobutton on an seperate Context-Attribut. But I didn´t know can I do this. And why there are always three Radio-Buttons? I need only two. Is there anywhere a Tutorial which describes the handling of the Radio-Buttons?

Kind regards

Axel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Axel,

did you have a look at the examples in the system? In SE80 <i>Web Dynpro Component/Intf</i> WDR_SELECT_OPTIONS and then there are the views Radiobutton, RadiobtnGrpByIdx and RadiobtnGrpByKey.

Regards, Heidi

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Axel,

if u need two radio buttons then insert child of type radio button .here is th simple example for creating and binding the buttons to selction key.

Example:

Assume that u r having 2 Radio buttons R1 and R2.

For this u create 3 attributes R1,R2 and Sel.

For the radio button R1:

set the element properties as:

keytoselect---R1

selected key --Sel

For the radio button R2:

set the element properties as:

keytoselect---R2

selected key --Sel

In implementation part :

public void wdDoInit()

{

//@@begin wdDoInit()

wdContext.currentContextElement().setR1("Pass");

wdContext.currentContextElement().setR2("Fail");

wdContext.currentContextElement().setSel("Pass");

//@@end

}

SO from the above code the default radio button R1 will be enabled.

If u want the second radio button to be default then change sel to

wdContext.currentContextElement().setSel("Fail");

so during run time when u select the first one automatically its selvalue changes according to the radio button's value.

*****Points Please......

Regards,

Krishnam Raju.

Former Member
0 Kudos

HI Axel,

If ur satisfied with my answer pls reward some points

regards,

krishnam raju

Former Member
0 Kudos

Hello Heidi,

thank you for your answer. I had a look at this WebDynpro. But I didn´t know how can I change the labels of the radio buttons?

Kind regards

Axel

thomas_szcs
Active Contributor
0 Kudos

Hi Axel,

The RadioButtonGroupByKey only visualizes itself to have 3 radio buttons in the workbench. You need to bind attribute selectedKey to a context attribute. The domain values (or a self-defined value set) of the type of that attribute defines how many radio buttons are shown.

In contrast to that RadioButtonGroupByIndex uses the context elements of a particular node to display the radio buttons. Just bind attribute texts to a context attribute of a multiple node (one with cardinality 0..N or 1..N).

There are examples in component WDR_TEST_EVENTS. Just copy the view you need to your component.

Best regards,

Thomas

Former Member
0 Kudos

Hello Valery,

thank you for your answer, but I didn´t know what you mean. I have made an Attribut with type f and this Attribut is bind to the group of checkboxes. But if I start the application, the checkboxes are not shown.

Kind regards

Axel

Former Member
0 Kudos

Ooops!

Axel, I reply in terms of WD for Java, not WD for ABAP (with wich I'm unfamiliar)

My pardons,

VS

Former Member
0 Kudos

Axel,

You need only one attribute, but this attribute must have enumeration.

Create your own simple type (on WD perspective, select Dictionary / Local dictionary / Simple Types in project tree), on second tab of type editor populate enumeration entries.

VS