on 10-12-2010 10:33 AM
Hi experts,
I have an input field, this is the only input field on my view ( a popup). How can I place the cursor in this input field so that the user can just start entering values? Otherwise the user has to first click on the field to make it active. The InputField UI element has no attribute relating to cursor, so is there some different way??
Thanks and regards,
Ira
Hi ,
Try to use REQUEST_FOCUS() method of IF_WD_VIEW_CONTROLLER .
Pass the input field reference to the method.
Thanks,
aditya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Aditya Karanth is right.
using the following example coding:
DATA:
lo_Node type ref to If_Wd_Context_Node,
lo_Elem type ref to If_Wd_Context_Element,
lo_ctrl TYPE REF TO IF_WD_VIEW_CONTROLLER .
lo_ctrl = wd_this->wd_get_api( ).
lo_Node = wd_Context->get_Child_Node( Name = 'NODE' ).
lo_Elem = lo_Node->get_element( ).
* set cursor
CALL METHOD lo_ctrl->REQUEST_FOCUS
EXPORTING
CONTEXT_ELEMENT = lo_Elem
ATTRIBUTE = 'I_MATNR'
.
"here, I_MATNR is my context attribute bound to input field named "Material Number"
However, this method needs your context node's cardinality as '1..1'. In fact, your input attributes are jsut '1..1'..
Thank you for your hints. I am now able to place the cursor in my input field. Especially once I realized I need to use a context node instead of just a context attribute
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 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.