cancel
Showing results for 
Search instead for 
Did you mean: 

change of lead selection on click on any cell

Former Member
0 Kudos

Hi ,

Can we change the lead selection on clik on any cell of the table. e.g I clik on any cell of the 2nd row then lead selection should get changed to 2nd row and if i clik on any cell of the 4th row then lead selection should get changed to 4th. In WD Java it is automatic but can i have same in WD ABAP also?

Regards

Govi

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>In WD Java it is automatic but can i have same in WD ABAP also?

Are you sure that is still the case. I'm pretty sure that as of CE that the table now functions just like WDA in that the selection column must be used to select/deselect rows.

Former Member
0 Kudos

Hi,

Can you please tell me how this can be achieved in WD Java

Thanks

uday_gubbala2
Active Contributor
0 Kudos

Hello Govind,

You had earlier raised another thread for another [lead selection requirement|] . You hadn't even confirmed the solution for that and you have came up with another new requirement. If that problem has been resolved kindly close that thread.

Coming to this new requirement of yours whenever an event is raised in a table you will have the WDEVENT parameter being passed to the action handler method. Using this WDEVENT you need to first get the context element & then using the context element you can use the get_index method of if_wd_context_element to get the row number from which the event was triggered. Then you can use this row number for setting the desired lead selection by using the method: set_lead_Selection_index of if_wd_context_node.

I am giving you a similar code fragment where I have made all the table cells as editable. I have coded an eventhandler method (ONENTER) to be triggered on press of enter in any column cells. (for event onEnter of the cell editor) Below is the coding from this eventhandler method:

method ONACTIONONENTER .
DATA: lr_element TYPE REF TO if_wd_context_element,
      lv_row_number type i value 0,
      lr_node type ref to if_wd_context_node.

" Get the reference of the corresponding context element from where event was triggered
  lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).

" Get the row number from where the event onEnter was triggered from
  lv_row_number = lr_element->get_index( ).

" Get reference of the context node which you have bound to your table
  lr_node = wd_context->get_child_node( name = 'NODE' ).

" Set the lead selection using the row number previously obtained  
  lr_node->set_lead_Selection_index( index = lv_row_number ).

endmethod.

Regards,

Uday

Former Member
0 Kudos

Hi Uday,

I think you are not getting my problem.

Which event are u talking abt actually that does not trigger when we only clik on that cell.if i have taken that cell as input field then a event is triggered wn i press enter key bcoz input field is having ON ENTER event.if that is a dropdown then event is triggered when i select a value.

situation is :

I am having a cell (an input field ) in my table which have an event ON ENTER but i dont want to press enter .I want an event when user has jst cliked on that cell nthng else.if there is any event which is triggered when we jst clik on that cell.like ON CLIK or smthng. please let me know.

and as i thnk i was not clear in my previous thread so i raise another one .I will close that.

Regards

govi

uday_gubbala2
Active Contributor
0 Kudos

Hi Govind,

You can't get an event triggered by just clicking inside a table's input field. (Rashmi has already said the same in the [other thread|] which you had created earlier. Check this, "If you are using an inputfield as the UI Element for the table column (Each cell in the column is a Input Field in this case), even then, you could define an event only on "OnEnter" and not on Click, since the InputField UI Element supports only OnEnter event.") You should try embed another ui element like button/LinkToAction within the cell editor so that an event gets triggered when the user presses on that element.

Regards,

Uday