on 05-14-2008 8:38 PM
Hello,
I've been trying to set focus at UI element(Input Field) but i can't get no results. When i click the button, the method is executed but nothing happens.
Here is my code:
DATA: l_api TYPE REF TO if_wd_view_controller.
l_api = wd_this->wd_get_api( ).
l_api->request_focus(
context_element= Elem_I_Zceldes_Desenv_Fun
attribute = 'BNAME' ).
Can someone help me?
Hi,
Write in wddomodify() of view/
If init is the node name having attribute initwhich is bound to an input field and you want to set focus on it then following code works
DATA:
lo_node TYPE REF TO if_wd_context_node,
lo_element TYPE REF TO if_wd_context_element,
lo_view_contr TYPE REF TO if_wd_view_controller.
lo_node = wd_context->get_child_node( name = wd_this->wdctx_init ).
lo_element = lo_node->get_element( ).
********************************************************************************
*........ Step 1 : To set focus on field 'init'...............
********************************************************************************
if first_time = abap_true.
lo_view_contr = wd_this->wd_get_api( ).
lo_view_contr->request_focus( exporting context_element = lo_element
attribute = 'init' ).
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
Write below code on OnEnter Action of the First input field.
data: lr_elem type ref to if_wd_view_element.
lr_elem = view->get_element( <ID of the second input field>).
if lr_elem is bound.
view->request_focus_on_view_elem( lr_elem ).
endif.
Do the same kind of proccedure for remaining input fields. i.e. OnEnter event of the second input field, set the focus on third input field with corresponding ID and so on....
Thanks,
Prashant
Hi all,
the last Post is right.
You have in every method or action the possibility with if_wd_view_controller->request_focus( ) to set the focus to an element.
kind regards
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
try this
data: lr_elem type ref to if_wd_view_element.
lr_elem = view->get_element( 'IP_FIRSTNAME' ).
if lr_elem is bound.
view->request_focus_on_view_elem( lr_elem ).
endif.
IP_FIRSTNAME is the ID of my input field.
regards
chythanya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Danilo
Try like this.
Here INP_PAR_LIFNR is the UI element id on the View
data: lv_v_elem type ref to if_wd_view_element.
lv_v_elem = view->get_element( 'INP_PAR_LIFNR' ).
if lv_v_elem is bound.
view->request_focus_on_view_elem( lv_v_elem ).
endif.
Regards
Naresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've not used that method to set the focus before, so I can't say what might be wrong. However there is another API method of the View itself. You might try that:
[http://help.sap.com/saphelp_nw70/helpdata/EN/42/f74da548bc3255e10000000a1553f7/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/EN/42/f74da548bc3255e10000000a1553f7/frameset.htm]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.