Skip to Content

Syntax for VIEW->GET_ELEMENT with complex layouts.

I want to set the focus to a field of a table which is inside a transparent container. View controller method GET_ELEMENT seems to be largely undocumented (the only thing I can find on it is "This method retrieves a view element with the specified ID or NULL if an element exists."

I can set the focus for a simple, top level field. How do I set it for a cell in a table?

And if you found this information in the documentation, then please tell me where it is!

Thanks for your help!


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Feb 18, 2008 at 07:48 AM

    Hello Russel,

    you need to specify the pointer to the context element that represents the line in

    addition while requesting the focus to be set on the view element.

    Best regards,


    Add a comment
    10|10000 characters needed characters exceeded

    • Thomas,

      Thanks for taking the time to answer.

      My problem results from there being two methods for setting focus...

      This one is used in WDDOMODIFYVIEW and uses view elements, which is what I was using.

      There may be a way of

      • view->request_focus_on_view_elem(

      • exporting view_element = lr_elem ).

      I have not found a way of telling it to select field CONNID of table SPFLI. It just focusses on the first thing in the table, which is the row-select button.

      However, your response prompted me to look further and I have successfully used this in the WDDOMODIFYVIEW method as well as other places...

      . lr_node = wd_context->get_child_node( 'SPFLI' ).

      . lr_element = lr_node->get_element( ).

      . if lr_element is bound.

      . lr_api = wd_this->wd_get_api( ).

      . lr_api->request_focus( context_element = lr_element

      . attribute = 'CONNID' ).

      . clear wd_this->focus_field.

      . endif.

      I think the trick in this case is to ignore view elements and go with what we know, which is context.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.