cancel
Showing results for 
Search instead for 
Did you mean: 

How to set text for checkbox dynamically in Webdynpro table cell

Former Member
0 Kudos

Dear Experts,

I've concern about setting text for checkbox in webdynpro table cell.

Those checkbox cell was created dynamically by standard logic CL_WD_CHECKBOX=>new_checkbox without passing 'BIND_TEXT'.

Currently i'm creating implicit enhancement to set BIND_TEXT in method NEW_CHECKBOX and it not working.

This is regarding RFX QUOT comparetion. whole view was created dynamiclly by /SAPSRM/IF_CLL_DODM_BEV_RES~GENERATE_VIEW_DYNAMIC .

Are there any way to achive this requirement ?

Any suggestion will be appriciated.

Regards

Eric


Accepted Solutions (1)

Accepted Solutions (1)

nishantbansal91
Active Contributor
0 Kudos

Dear Eric,

At back end each input element has one dynamic class.

Please check once configuration side also. i think for changing the text there will some configuration table also.

I think enhancing the standard class, it is wrong way, because it hampers all the other components.

So please check what is call stack before calling this method CL_WD_CHECKBOX=>new_checkbox .

because bind_Text is importing parameter of method NEW_CHECKBOX. so i would recommend you first check the call stack and if possible pass the value directly to class.

Thanks

Nishant

Former Member
0 Kudos

Hi Nishant,

Thanks for your reply.

I've checked the logic where call NEW_CHECKBOX.  BIND_TEXT parameter was commented in the class. Since checkbox was created dynamically I can't find any table to control that.

Thanks again.

Regards

Eric

Gowtham
Contributor
0 Kudos

Hi Eric,

Can you try the method : SET_TEXT( ) from the class CL_WD_CHECKBOX


- Gowtham

Former Member
0 Kudos

Hi Gowtham,

Yes! It works!

Thanks for you help.

Regards

Eric

Former Member
0 Kudos

Hi Gowtham,

I'm able to set text for checkbox now. But this method set text to every checkbox in whole column  .

Are there any way that i can set spicfied checkbox cell ?

This is my code.

  DATA: lo_table TYPE REF TO cl_wd_table.
  DATA: lo_column TYPE REF TO cl_wd_table_column.
  DATA: lo_element TYPE REF TO if_wd_view_element.
  DATA: lo_editors  TYPE REF TO if_wd_table_cell_editor.
  DATA: table_columns   TYPE cl_wd_table_column=>tt_table_column.
  DATA: lo_cellvar TYPE REF TO cl_wd_abstr_table_cell_var.
  DATA: lo_st_cell TYPE REF TO  cl_wd_table_standard_cell.
  DATA: lo_editor TYPE REF TO if_wd_table_cell_editor.
  DATA: lo_checkbox TYPE REF TO cl_wd_checkbox .

  CALL METHOD view->get_element
    EXPORTING
      id      = 'COMPARISION_TABLE'
    RECEIVING
      element = lo_element.
  lo_table ?= lo_element.
  lo_column = lo_table->get_column(  index      = 2).
          
  CHECK lo_column  IS NOT INITIAL.

  CALL METHOD lo_column->get_cell_variant
    EXPORTING
     index            =  2
    RECEIVING
      the_cell_variant = lo_cellvar.

  lo_st_cell ?= lo_cellvar.
  call method lo_st_cell->get_editor
    receiving
      the_editor = lo_editor.   .

lo_checkbox ?=  lo_editor.
lo_checkbox->set_text( value = 'test-text' ).

Any suggestion will be appriciated.

Thanks & Regards

Eri

Answers (0)