METHOD GET_P_INTERNAL_ID.
CASE iv_property.
WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
rv_value = cl_bsp_dlc_view_descriptor=>field_type_event_link.
WHEN if_bsp_wd_model_setter_getter=>fp_onclick.
rv_value = 'ATTACHMENT'.
ENDCASE.
ENDMETHOD.
DATA: lr_popup TYPE REF TO IF_BSP_WD_POPUP,
lv_post TYPE REF TO cl_crm_bol_entity,
lv_bol_col TYPE REF TO CL_CRM_BOL_BO_COL.
lv_post = zcl_jerry_tool=>get_selected_post_by_event( iv_col_wrapper = me->typed_context->searchresult->collection_wrapper
iv_event = htmlb_event_ex->event_id ).
CREATE OBJECT lv_bol_col.
lv_bol_col->IF_BOL_BO_COL~add( lv_post ).
lr_popup = comp_controller->window_manager->create_popup(
iv_interface_view_name = 'ZSMCATT/MainWindow'
iv_usage_name = 'ZSMCATT'
iv_title = 'Social Post Attachment Maintenance' ).
lr_popup->set_on_close_event( iv_view = me iv_event_name =
'CLEAR').
lr_popup->open( iv_inbound_plug = 'FROM_SEARCH' iv_collection = lv_bol_col ).
all the content in pop up window is encapsulated in interface view MainWindow of ZSMCATT. Our next step will focus on its implementation.
the method get_selected_post_by_event is a handy method which just returns the selected post BOL entity via event:
DATA:
lv_index_str TYPE string,
lv_idx TYPE string,
lv_index TYPE i,
lv_result TYPE REF TO cl_crm_bol_entity.
lv_index_str = iv_event.
SHIFT lv_index_str UP TO '[' LEFT CIRCULAR.
SHIFT lv_index_str BY 1 PLACES.
WHILE lv_index_str(1) <> ']'.
CONCATENATE lv_idx lv_index_str(1) INTO lv_idx.
SHIFT lv_index_str BY 1 PLACES.
ENDWHILE.
lv_index = lv_idx.
CHECK lv_index >= 0.
lv_result ?= iv_col_wrapper->find( iv_index = lv_index ).
CHECK lv_result IS NOT INITIAL.
rv_result = lv_result->get_related_entity( 'SocialPostRel' ). "#EC NOTEXT
method WD_USAGE_INITIALIZE.
DATA:
lv_usage TYPE REF TO if_bsp_wd_component_usage,
lo_entity TYPE ref to cl_crm_bol_entity.
CHECK me->typed_context->socialpost->collection_wrapper IS NOT INITIAL.
lv_usage = me->comp_controller->get_component_usage( iv_usage->usage_name ).
IF lv_usage->usage_name = 'ZSMCATT'.
CALL METHOD lv_usage->bind_context_node
EXPORTING
iv_controller_type = cl_bsp_wd_controller=>co_type_component
iv_target_node_name = 'SOCIALPOST' "#EC NOTEXT
iv_node_2_bind = 'SOCIALPOST'. "#EC NOTEXT
ENDIF.
endmethod.
METHOD on_new_focus.
DATA: lr_qs TYPE REF TO cl_crm_bol_query_service,
lr_data TYPE REF TO data,
ls_cmbo_prop TYPE crmt_cmic_rfolder_attr,
lr_entity_col TYPE REF TO if_bol_entity_col.
FIELD-SYMBOLS: <fs_guid> TYPE crmt_genil_object_guid.
CHECK focus_bo IS BOUND.
TRY.
lr_qs = cl_crm_bol_query_service=>get_instance( cl_crm_cm_genil_comp=>gc_query_bo_link ).
CATCH cx_root. "#EC NO_HANDLER
RETURN.
ENDTRY.
CHECK lr_qs IS BOUND.
lr_data = focus_bo->get_property( 'UUID' ).
ASSIGN lr_data->* TO <fs_guid>.
ls_cmbo_prop-instid = <fs_guid>.
ls_cmbo_prop-typeid = 'BUS1006'. ------------- use your own BOR type here!
ls_cmbo_prop-catid = 'BO'.
lr_qs->set_properties( ls_cmbo_prop ).
lr_entity_col = lr_qs->get_query_result( ).
me->collection_wrapper->clear_collection( ).
me->collection_wrapper->set_collection( lr_entity_col ).
ENDMETHOD.
METHOD wd_usage_initialize.
DATA: lr_cn TYPE REF TO cl_bsp_wd_context_node,
lr_property TYPE REF TO if_bol_bo_property_access,
lr_cn_attr TYPE REF TO if_bol_bo_property_access,
lr_cuco_attachement TYPE REF TO CL_ZSMCATT_CMBO_IMPL,
ls_cm_attr TYPE crmt_cm_comp_st.
IF NOT me->context IS BOUND.
me->wd_create_context( ).
ENDIF.
CASE iv_usage->usage_name.
WHEN 'AttachmentUploadDet' or 'AttachmentUpload' or 'AttachmentProperty'.
CALL METHOD iv_usage->bind_context_node
EXPORTING
iv_controller_type = cl_bsp_wd_controller=>co_type_custom
iv_name = 'ZSMCATT/CMBO'
iv_target_node_name = 'CMBO' "#EC NOTEXT
iv_node_2_bind = 'CMBUSOBJ'. "#EC NOTEXT
CALL METHOD iv_usage->bind_context_node
EXPORTING
iv_controller_type = cl_bsp_wd_controller=>co_type_component
* node at the calling component
iv_target_node_name = 'SOCIALPOST' "#EC NOTEXT
* name of the called component
iv_name = iv_usage->usage_name
* node at the called component
iv_node_2_bind = 'PARENTNODE'.
ENDCASE.
ENDMETHOD.
lr_cuco_attachement ?= get_custom_controller( 'ZSMCATT/CMBO' ).
IF lr_cuco_attachement IS BOUND.
lr_property = me->typed_context->socialpost->collection_wrapper->get_current( ).
lr_cuco_attachement->typed_context->cmbo->on_new_focus( lr_property ).
lr_cuco_attachement->typed_context->attribute->on_new_focus( lr_property ).
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 |
---|---|
6 | |
6 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |