cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic scrolling

Former Member
0 Kudos

HI ALL,

I have this problem. I have a hierachical table with many rows. I have a button "SEARCH" and this functionality allows to find and selected a row with the first field equal at the element that I want to search. Is it possible to scrolling automatically the table until at the selected row?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Practically I want that at the end of my search the visualization of my table is positioned automatically on the selected row as an automatic scrolling. Is it possible this in WDA?

gill367
Active Contributor
0 Kudos

Have you tried using set_focus method.

it might help.

thanks

sarbjeet

Former Member
0 Kudos

Which is the class of this method (set_focus)?

gill367
Active Contributor
0 Kudos

Not exactly set focus

it is request _focus.

you can request focus for a particular element and particular attribute.

use this sample code for reference..

data: MY_CONTEXT_NODE    type ref to IF_WD_CONTEXT_NODE,
        MY_CONTEXT_ELEMENT type ref to IF_WD_CONTEXT_ELEMENT,
        MY_RUNTIMEAPI       type ref to IF_WD_VIEW_CONTROLLER.
 
  MY_CONTEXT_NODE = WD_CONTEXT->GET_CHILD_NODE('<nodename>' ).
  MY_CONTEXT_ELEMENT = MY_CONTEXT_NODE->GET_ELEMENT( 1 ).  " get the element here
  MY_RUNTIMEAPI = WD_THIS->WD_GET_API( ).
  MY_RUNTIMEAPI->REQUEST_FOCUS( ATTRIBUTE = <attribute name>' CONTEXT_ELEMENT = MY_CONTEXT_ELEMENT ).

thanks

Former Member
0 Kudos

Ok I use this code:

CALL METHOD MY_RUNTIMEAPI->REQUEST_FOCUS

EXPORTING

CONTEXT_ELEMENT = lo_nd_element

ATTRIBUTE = 'TREE_COLUMN_TEXT'.

where lo_nd_element is my selected row, and 'TREE_COLUMN_TEXT' is the name of the first field of my row.

Unfortunately this code does not reflect any changes... Where is my error?

gill367
Active Contributor
0 Kudos

what is the field type. is it a text view.

try to focus input field if you have one .

thanks

sarbjeet

Former Member
0 Kudos

No, the field TREE_COLUMN_TEXT is a string, lo_nd_element is a selected row of my table...

Former Member
0 Kudos

the field TREE_COLUMN_TEXT is a "link_to_action"...

gill367
Active Contributor
0 Kudos

HI gc,

sorry mate, i checked using a test application for the same scenario.

the focus is going there but automatic scrolling is still not happening.

so i guess its not possible to get the same.

can't you display all the rows.

thanks

sarbjeet

Former Member
0 Kudos

Hi,

I solved following this thread:

regards