cancel
Showing results for 
Search instead for 
Did you mean: 

request focus on view element

Former Member
0 Kudos

Hi everybody,

I have a little problem and I didn't know how to solve it. I'd like to set the cursor at any input field at my view.

I tried this like this way:

DATA: lr_elem TYPE REF TO if_wd_view_element.

....

lr_elem = view->get_element( gv_cursor ).

view->request_focus_on_view_elem( lr_elem ).

If I start the webdynpro the cursor was set at the right position...now if I press enter or a button at the dynpro the program logic will be done and the method WDDOMODIFYVIEW will be processed again...but the cursor were not set at any field at the dynpro, why?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

thanks for your help, but still the same problem...if I start the webdynpro the cursor was set at the right position and on the next call of WDDOMODIFYVIEW the cursor weren't set!!

Former Member
0 Kudos

Perhaps enter SMP message.

Are you on the latest SP ?

My test WDC showed It could control the cursor with buttons.

You can see the test if you like,

Email me and I can send you connection details.

phil.soady (at) sap.com

cheers

Phil

thomas_szcs
Active Contributor
0 Kudos

Hi Stefan,

The were a few problems in the past with keeping the cursor at the right place within the browser, but they should have been solved by now. There are a few notes describing those bug fixes. Just search for notes containing the term "focus" and restrict the search to component BC-WD-*. In case the problem persists, please don't hesitate to open a support ticket.

Best regards,

Thomas

Former Member
0 Kudos

> Perhaps enter SMP message.

> Are you on the latest SP ?

>

> My test WDC showed It could control the cursor with

> buttons.

>

> You can see the test if you like,

> Email me and I can send you connection details.

> phil.soady (at) sap.com

>

> cheers

> Phil

I'm on SP 5...at weekend the system will be updated on SP 10, so I try it next week again...

Former Member
0 Kudos

Problem is solved now...it was SP5...on SP8 it works correctly!

Answers (1)

Answers (1)

Former Member
0 Kudos

The following works in SP10.

I cant see what you have missed:

My test was 2 buttons, each button changes the focus to a different input field.

Attribute called FIELD was declared.

method WDDOMODIFYVIEW .

  DATA: lr_elem TYPE REF TO if_wd_view_element.


lr_elem = view->get_element( wd_this->field ).

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

endmethod.

method ONACTIONSET_F1 .
  wd_this->field = 'F1'.
endmethod.
method ONACTIONSET_F2 .
  wd_this->field = 'F2'.
endmethod.

regards

Phil