cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic radio button group by index creation

0 Kudos

Hi ,

I have created radio button group by index pro-grammatically and it working fine  with dynamic node and dynamic attribute,

but it is not displaying the text as below :

Sample code :

           dyn_node = wd_context->get_child_node( name = lv_id3 ).

          dyn_node->bind_table( new_items = <tab> set_initial_elements = abap_true ).

           CALL METHOD cl_wd_radiobutton_group_by_idx=>new_radiobutton_group_by_idx

             EXPORTING

               bind_texts                 = c_radbindkey

               id                         = lv_id2

             RECEIVING

               control                    = lr_rbi.           

           lr_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( lr_rbi ).

           lr_rbi->set_layout_data( lr_matrix ).

           CALL METHOD lr_container->add_child

             EXPORTING

               the_child = lr_rbi.



The same issue is occurring for dynamic check box group .

Please suggest .





Thanks,

Suchi.




Accepted Solutions (0)

Answers (1)

Answers (1)

former_member184578
Active Contributor
0 Kudos

Hi,

You are not populating the <tab> in the bind_table( ) method of radio button node!

I just modified in your code as below:

DATA lt_rb TYPE wd_this->elements_rb.

    DATA ls_rb TYPE wd_this->element_rb.

* Populate radio button texts  " RB is name of node, val is name of attribute to which texts is bound

    ls_rb-val = 'A'.

    APPEND ls_rb to lt_rb.

    ls_rb-val = 'B'.

    APPEND ls_rb to lt_rb.

    ls_rb-val = 'C'.

    APPEND ls_rb to lt_rb.

   dyn_node = wd_context->get_child_node( name = 'RB' ).

      dyn_node->bind_table( new_items = lt_rb set_initial_elements = abap_true ).

Regards,

Kiran