cancel
Showing results for 
Search instead for 
Did you mean: 

Radio button dynamic events

Former Member
0 Kudos

Hai,

I am using two radio buttons above the table. If i click first radio button table below should show the fields with some colyumn in drop down option. if i select other one it should show the table cell with editable options(instead of drop down). any ideas pls

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Rupa,

Yes it is possible do in this way...

read the radio button value into the WDMODIFYVIEW method.

depend up on your radio button make cell editor of column accrodingly.

if rad1 = 'X'.
lr_column->set_table_cell_editor( the_table_cell_editor = lr_drdn  ).
else if rad2 = 'X'.
lr_column->set_table_cell_editor( the_table_cell_editor = lr_input  ).
endif.

to make input editable cells write the below code to make input editable.

*Cretate input field
lr_input = cl_wd_input_field=>new_input_field(
      bind_value          = 'FLIGHTS.PRICE'
      id                  = 'IP1'
        ).
*Make editable 
 lr_input->set_read_only( value = abap_false   ).

Thanks

Suman

Former Member
0 Kudos

thank you suman

Is that possible to make a field editable and also with drop down . like we enter the font size in drop down also we can select in drop down option in ms word know...

let me know if u want things in detail

Former Member
0 Kudos

Hi,

Yes it is possible as i alredy given some inputs to you.

I didnt understand your second question.can you explain me more eloborately.

Thanks

Suman

Former Member
0 Kudos

just like in ms word for font size we can use drop down and also directly we can type the value know. like that am asking . I want to make a column in ordinary table like both editable and also drop down

uday_gubbala2
Active Contributor
0 Kudos

Hi Suman,

Have some query regarding what you had said. You had asked to write as:

lr_column->set_table_cell_editor( the_table_cell_editor = lr_drdn ).

Am confused as to how we can accomplish this. I thought to try accomplish changing the cell editor of a column which displays PRICE information from MARA. I tried coding in the onSelect event as below. ( I am trying to handle just 1 state of the radiobutton & intend to convert the cell editor to an dropdown element.) Also gr_table is my view attribute of type cl_wd_table & I have saved the table reference into it from wddomodifyview)

DATA: lr_column type ref to cl_wd_table_column,

lr_dropdown type ref to IF_WD_TABLE_CELL_EDITOR.

if rad1 = 'X'.

lr_column ?= wd_this->gr_table->get_grouped_column( id = 'TABLE_PRICE' ).

lr_dropdown ?= CL_WD_DROPDOWN_BY_IDX=>NEW_DROPDOWN_BY_IDX( BIND_TEXTS = 'TEST' ).

lr_column1->set_table_cell_editor( THE_TABLE_CELL_EDITOR = lr_dropdown ).

else.

endif.

But it isnt working this way. Its ending up in a dump. Thought to try paste the error analysis to you but the IDES is down. Can you please try say about the coding a bit more in detail?

Thanks,

Uday

Former Member
0 Kudos

Hi Rupa,

I understood your requirement.you want to implement the drop down functionality of ms word in Web Dynpro.Absolutely we cannot do this in WDA.

Thanks

Suman

uday_gubbala2
Active Contributor
0 Kudos

Hi Suman,

Thanks a lot for the detailed coding & my apologies for the very late reply. I missed out on following this thread. Suman I did try with the same coding that you have given me and its going to a dump. Its to do something with an issue which I had faced even earlier. When I try to use the get_column( ) method it returns an null object. I had faced this problem in 1 of my posts earlier & Thomas Szuecs had pointed out that the Table UI element has been enhanced to include what are called as grouped columns. While debugging inside the SAP standard code for get_column( ) it was reading an internal table ME->ch_COLUMNS to get the list of columns. But this table was empty and so the READ was failing leading to an NULL pointer exception. The ME->CH_GROUPED_COLUMNS had the references for the table columns. Even now when I tried implementing get_column( ) as how you pointed out, it was the same problem. Its why I was trying to code as:

DATA: lr_column type ref to cl_wd_table_column,
lr_dropdown type ref to IF_WD_TABLE_CELL_EDITOR.

lr_column ?= wd_this->gr_table->get_grouped_column( id = 'TABLE_PRICE' ).
lr_dropdown ?= CL_WD_DROPDOWN_BY_IDX=>NEW_DROPDOWN_BY_IDX( BIND_TEXTS = 'TEST' ).
lr_column1->set_table_cell_editor( THE_TABLE_CELL_EDITOR = lr_dropdown ).

But I get an error saying as, "Subnode MAIN.ME does not exist". This error is generated at line 24 in method GET_CHILD_NODE_INTERNAL of class CL_WDR_CONTEXT_ELEMENT . I tried debugging but wasnt able to understand as to how & where this "ME" comes from. I only have 2 context nodes SFLIGHT (for binding to the table) & RB (for the radiobutton texts). Do you have any idea as what might be wrong?

Uday

arjun_thakur
Active Contributor
0 Kudos

Hi rupachandran

You create two seprate views. in one view you create a table with drop downs and in other view you create a table with editable options. now embed these views in the viewcontainer of the main view which contains your radio button as well. now when you select first button call the view which contain table having drop down and when u select other radio button, call the other view. you can call the view by using fire plugs.

I hope it helps.

regards

arjun

Edited by: Arjun on Sep 23, 2008 7:28 AM