Header Ads

Difference between custom and component controller


The main difference between custom and component controller is the role which they play during data transfer.

a) Custom controller is used for data transfer across two views within a component. For that you need to bind view context nodes to custom controller either through wizard or manually by adding the code in CTXT class create_contextnode method:

  • initial setting for depandant model node
    coll_wrapper =
      BTADMINH->get_collection_wrapper( ).
    TRY.
        entity ?= coll_wrapper->get_current( ).
      CATCH cx_sy_move_cast_error.
    ENDTRY.
    IF entity IS BOUND.
      BTOpportH->on_new_focus(
                   focus_bo = entity ).
    ENDIF.

b)Component controller is used for data transfer across two views in two different components. For this, we need to define the component usage first and then bind the context nodes in the method-WD_USAGE_INITIALIZE of the Component Controller impl class.

    WHEN 'ComponentUsageName'.
      iv_usage->bind_context_node(
                  iv_controller_type  = cl_bsp_wd_controller=>co_type_custom
                  iv_target_node_name = 'ContextNodeName'  "#EC NOTEXT
                  iv_node_2_bind      = 'ContextNodeName' ).  "#EC NOTEXT
Powered by Blogger.