cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the focus of particular UI Element

Former Member
0 Kudos

Hi All,

How to get the focus of particular UI Element in webdynpro Page,

I have a page where i am creating a ALV, I want to get that keyboard focus is on that element is there or not?

Can anyone please give some update?

Best regards,

Rohit

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

its not as per we want, we will try some other way.

Former Member
0 Kudos

its not as per we want, we will try some other way.

Former Member
0 Kudos

In order to get focus you need to call focus method for that particulat UI element.

data: lr_inp_field type ref to cl_wd_input_field.

//create instance

//call method

lr_inp_field->focus( ).

for ALV is component, it may not be directly possible to put focus on a Particular single UI element within it , however you can always call focus Method in the Transparent Container or ViewUIElement container ( CL_WD_VIEW_CONTAINER_UIELEMENT) where this ALV is embeded.

Greetings

Prasshant

Former Member
0 Kudos

Hi Prashant

Thanks for your input,

The case is, i have a ALV and i want to refresh it when the focus is on that ALV only with some hot key.

Where should i should get the focus, like user can be at any part of screen and he can press that key, i want to refresh only when focus is on that ALV only.

Best regards,

Rohit

Former Member
0 Kudos

I would suggest try invoking REFRESH of ALV on the ON_CELL_ACTION event.

Below excerpt is from Thomas

The Events of inner UI elements are not exposed directly as they normally would be if they were standalone. Generally you can capture them using either the 

ON_DATA_CHECK:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/c8/6c80dbedfe42d1a93f8e6df1d7244a/frameset.htm
This gets trigger for any press of ENTER, so it generally works like the Input Field onEnter.

You could also consider ON_CELL_ACTION:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/45/12093591152464e10000000a1553f7/frameset.htm
It is a higher level Event that encompasses both ON_DATA_CHECK and ON_CLICK.

if you want to capture & refresh on some hot key combination then refer to this thread

[https://www.sdn.sap.com/irj/scn/profile?editmode=true&userid=3760417]