cancel
Showing results for 
Search instead for 
Did you mean: 

Clearing dropdown selection without refreshing the table

Former Member
0 Kudos

Hi, is there a way to clear the dropdown selection without refreshing the table?

I currently have a Create New Form page. If I click on BACK and then go into a new Create New Form page, the selection in the dropdown box should be cleared, but table (dropdown list) retained.

I populated the dropdown in WDDOINIT method, hence when I return to the Create New Form page the 2nd time, WDDOINIT does not get called, hence if I invalidate my dropdown, it will always be empty from then onwards.

I tried to SET_ATTRIBUTE to '' but it somehow refreshes the whole dropdown list to empty instead of just the selection.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi

use set_lead_selection for the same

1 append initial line to ur internal table


APPEND INITIAL LINE TO itab.
// itab is the internal table which is binded to the drop down

2 now set the lead selection to 1



  DATA : lo_nd_cn_sapsystem TYPE REF TO if_wd_context_node ,
         lo_el_cn_sapsystem TYPE REF TO if_wd_context_element ,
         ls_cn_sapsystem    TYPE wd_this->element_cn_sapsystem.
* navigate from <CONTEXT> to <CN_ROLELEVEL> via lead selection
  lo_nd_cn_sapsystem = wd_context->get_child_node(
  name = wd_this->wdctx_cn_sapsystem ).


  lo_nd_cn_sapsystem->set_lead_selection_index( 1 ).

I hope it shud help

rgds,

amit

Former Member
0 Kudos

Hi Helmut, thanks for the suggestion. Didn't see that. Thought it would work but not sure why it didn't when I tried to.

Thanks amit for your solution. I changed the index to 0 (to reset to initial) and it worked fine.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

a simple solution is, to call the CLEAR_SELECTION method on the node that holds the data for your dropdown box.

Regards,

Helmut