cancel
Showing results for 
Search instead for 
Did you mean: 

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

former_member267851
Participant
0 Kudos

Hi Experts,

I have a requirement where i need to access context node used by component usage .

In particular i have Bt***h_srvo Component where customer_h is used by component usage.

how to access this context node of customer_h in SRVO Component ????

Is it Possible to add attribute dynamically as check-box  to customer_h in Srvo Component

without inheriting Customer_h component ???

Thanks and Regards

Alok

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

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' )