cancel
Showing results for 
Search instead for 
Did you mean: 

radio button in web dynpro

Former Member
0 Kudos

Hello..

I was playing around the UI elements of web dynpro . I want to display three radio buttons on the screen for three colors and after that I have a submit button below it.

Later on I will write some logic under the button submit onaction method, but for now I am struggling with the radio button.

I have added RADIOBUTTONGROUPBYINDEX element to my layout and I see the three radio buttons added without any captions. I got stuck here. How to give the captions to the radio button ?

Thanks for your time.

Peeru.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Indrani,

Create a Node (like RBGRP) with cordinality 0..n and add Attribute(like TEXT1) in context with STRING type.

For RBGRP provide supply function name example (FILL_DESCRIPTION).

add the texts to internal

check below code ..

method FILL_DESCRIPTION .

  • General Notes

  • =============

  • A common scenario for a supply method is to aquire key

  • informations from the parameter <parent_element> and then

  • to invoke a data provider.

  • A free navigation thru the context, especially to nodes on

  • the same or deeper hierachical level is strongly discouraged,

  • because such a strategy may easily lead to unresolvable

  • situations!!

  • if necessary, get static attributes of parent element

  • DATA ls_parent_attributes TYPE wd_this->element_context.

  • parent_element->get_static_attributes(

  • IMPORTING

  • static_attributes = ls_parent_attributes ).

*

    • data declaration

DATA lt_rbgrp TYPE STANDARD TABLE OF IF_MAIN=>Element_rbgrp.

DATA ls_rbgrp LIKE LINE OF lt_rbgrp.

  • @TODO compute values

  • e.g. call a data providing FuBa

ls_rbgrp-TEXT1 = 'Button1'.

INSERT ls_rbgrp into table lt_rbgrp.

ls_rbgrp-TEXT1 = 'Button2'.

INSERT ls_rbgrp into table lt_rbgrp.

ls_rbgrp-TEXT1 = 'Button3'.

INSERT ls_rbgrp into table lt_rbgrp.

  • bind all the elements

node->bind_table(

new_items = lt_rbgrp

set_initial_elements = abap_true ).

*

endmethod.

///Happy coding.

Kiran Singh

Former Member
0 Kudos

Thanks to everyone.

Kiran's code has helped me in solving the problem I had with the ABAP dynpro radio button.

Edited by: Peeru Indrani on Oct 2, 2008 4:46 PM

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,

please go through this standard example

WDR_TEST_UI_ELEMENTS

Former Member
0 Kudos

Hi,

The following document may help you.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b057594c-9064-2b10-24b8-977738d0...

or check the standard demo Program.

WDR_TEST_EVENTS

Thanks,

Sree.