cancel
Showing results for 
Search instead for 
Did you mean: 

How to set focus on UI Element

Former Member
0 Kudos

Hi All,

I am using the below code to set the focus on the first row of the table given in the link [ ] on enter of an event.

data: lr_elem type ref to if_wd_view_element.
lr_elem = view->get_element( <ID of the Link to Action field>).

if lr_elem is bound.
view->request_focus_on_view_elem( lr_elem ).
endif.

I am getting "Cannot use NULL reference as object error at view".

Can you please tell me how to get the reference of the "view".

Thanks

Praveen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

In your code in your method 'onEnter' , just use setLeadSelection on the table.

regards

yuval

Answers (2)

Answers (2)

gill367
Active Contributor
0 Kudos

Where are you writing this code. it should be in wddomodify.

thanks

sarb

Former Member
0 Kudos

>

> Hi All,

>

> I am using the below code to set the focus on the first row of the table given in the link [ ] on enter of an event.

>

>

data: lr_elem type ref to if_wd_view_element.
> lr_elem = view->get_element( <ID of the Link to Action field>).
> 
> if lr_elem is bound.
> view->request_focus_on_view_elem( lr_elem ).
> endif.

>

> I am getting "Cannot use NULL reference as object error at view".

>

> Can you please tell me how to get the reference of the "view".

>

> Thanks

> Praveen

Hallo Praveen,

have you controlled that id of the Linktoaction ? there you made error.

See it in the ViewElement designer .

should be something like this

lr_elem = view->get_element( 'LTA_name ' ).