cancel
Showing results for 
Search instead for 
Did you mean: 

how can i get cursor by default in input field ?

Former Member
0 Kudos

hii ,

i want to get cursor in input field by default after excuting the wdb application ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi...thanks for all i got it

thanks a lot...

i got problem with id parameter ..

i resolved it ....

Thanks And Regards ..

Lokesh

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Lokeswar,

From the view, get the element, and use the request_focus_on_view_elem method for that

element_type ?= view->get_element( 'ELEMENT_NAME' ).


       element_container->view->request_focus_on_view_elem( element_type ).

Best regards,

Rohit

Former Member
0 Kudos

hii rohit ...

  pls give me some sqample code..

??

Former Member
0 Kudos

In the do modify method, i have to set focus on some UI element by default.

I will use like this.

data: lr_root_container type ref to CL_WD_TRANSPARENT_CONTAINER,

         lr_group_link TYPE REF TO cl_wd_group.

   if first_time = 'X'.

*   update view data

     lr_root_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).

       "lr_root_container->focus( ).

       lr_group_link ?= view->get_element( 'GROUP_LINKS' ).

       lr_root_container->view->request_focus_on_view_elem( lr_group_link ).

     endif.

As you have a input element use that in place of cl_wd_group.

Best regards,

Rohit

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

In MODIFYVIEW, do the following.

   DATA lo_element TYPE REF TO IF_WD_VIEW_ELEMENT.
if first_time eq abap_true.
  CALL METHOD view->get_element
    EXPORTING
      id      = 'INPUT_FIELD'
    receiving
      element = lo_element.
  IF lo_element IS NOT INITIAL.
    CALL METHOD view->request_focus_on_view_elem
      EXPORTING
        view_element    = lo_element.
  ENDIF.
endif.

Former Member
0 Kudos

Hi Jayanthi Jayaraman thnaks for ur reply but its not working..

any other solution pls let me knw..

thanks

Lokesh