on 02-16-2008 11:29 AM
I have been asked to position the cursor to the first element with an error after validation. I can get a list of error messages from IF_WD_MESSAGE_MANAGER, and from that I can get the element and attribute in the context node. However, to set the focus, I have to refer to a view element. Is there a neat way of doing this?
Thanks for your help
OK, I will do the George thing and answer my own question.
The solution comes from an unlikely source - WDR_TEST_FOCUS - who would have thought?
This allows me to set the focus knowing the context element rather than the view element.
In this particular example, the focus is set to a table cell.
l_node = wd_context->get_child_node( 'SPFLI' ).
l_element = l_node->get_element( index = l_index ).
if l_element is bound.
. l_api = wd_this->wd_get_api( ).
. l_api->request_focus( context_element = l_element
. attribute = l_attribute ).
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
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.