Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9041

Re: How to Access a Component Usage Context Node in Parent Component.

$
0
0

Hi, I managed to access the context node of a component usage in one of my projects with the code below.

 

Unsure if this is the best way of doing it, but it seems to work.

 

 

    data lr_window type ref to cl_bsp_wd_controller.

    data lr_comp_controller type ref to <<COMPONENT CONTROLLER CLASS FROM YOUR COMPONENT USAGE>.

 

   "--- Get the interfaced window from your component usage...

    lr_window ?= me->get_subcontroller_by_viewname( iv_viewname = 'CU_YOUR_COMPONENT_USAGE.USED_COMPONENT/MainWindow' ).

    check lr_window is bound.

 

   "--- Get component controller from component usage

    lr_comp_controller ?= lr_window->m_parent.

 

    "--- Check component usage context node size...

    check lr_comp_controller->typed_context->parent->collection_wrapper->size( ) > 0.

 

   "--- Get something out of the context node...

    data(lv_id) = me->typed_context->your_context_node->collection_wrapper->get_current( )->get_property_as_string( iv_attr_name= 'ID' )


Viewing all articles
Browse latest Browse all 9041

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>