view model update event logic (#1002)

This commit is contained in:
oblomov 2024-03-09 15:11:06 -05:00 committed by GitHub
parent e48640eff0
commit 0a6b38e7ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 8 deletions

View File

@ -7,12 +7,12 @@ CLASS z2ui5_cl_core_event_srv DEFINITION
METHODS get_event
IMPORTING
!val TYPE clike OPTIONAL
!t_arg TYPE string_table OPTIONAL
!s_cnt TYPE z2ui5_if_types=>ty_s_event_control OPTIONAL
!val TYPE clike OPTIONAL
!t_arg TYPE string_table OPTIONAL
!s_cnt TYPE z2ui5_if_types=>ty_s_event_control OPTIONAL
PREFERRED PARAMETER val
RETURNING
VALUE(result) TYPE string.
VALUE(result) TYPE string.
METHODS get_event_client
IMPORTING
@ -39,7 +39,17 @@ CLASS z2ui5_cl_core_event_srv IMPLEMENTATION.
result = |{ z2ui5_if_core_types=>cs_ui5-event_backend_function }(['{ val }'|.
IF s_cnt-check_allow_multi_req = abap_true.
IF s_cnt-model_name IS NOT INITIAL.
IF s_cnt-check_allow_multi_req = abap_true.
IF s_cnt-check_view_destroy = abap_true.
result = result && `,true,true, "` && s_cnt-model_name && `"`.
ELSE.
result = result && `,false,true, "` && s_cnt-model_name && `"`.
ENDIF.
ELSE.
result = result && `,false,false, "` && s_cnt-model_name && `"`.
ENDIF.
ELSEIF s_cnt-check_allow_multi_req = abap_true.
IF s_cnt-check_view_destroy = abap_true.
result = result && `,true,true`.
ELSE.

View File

@ -317,10 +317,12 @@ CLASS Z2UI5_CL_CORE_HTTP_GET IMPLEMENTATION.
` }` && |\n| &&
` sap.z2ui5.isBusy = true;` && |\n| &&
` BusyIndicator.show();` && |\n| &&
* ` let appStart = sap.z2ui5.oBody.APP_START;` && |\n| &&
` sap.z2ui5.oBody = {};` && |\n| &&
* ` sap.z2ui5.oBody.APP_START = appStart;` && |\n| &&
` if ( sap.z2ui5.oController == this ) {` && |\n| &&
` if ( args[0][3] ) {` && |\n| &&
` sap.z2ui5.oBody.XX = sap.z2ui5.oView.getModel().getData().XX;` && |\n| &&
` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
` }` && |\n| &&
` else if ( sap.z2ui5.oController == this ) {` && |\n| &&
` sap.z2ui5.oBody.XX = sap.z2ui5.oView.getModel().getData().XX;` && |\n| &&
` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
` }else if ` && |\n| &&

View File

@ -48,6 +48,7 @@ INTERFACE z2ui5_if_types
BEGIN OF ty_s_event_control,
check_view_destroy TYPE abap_bool,
check_allow_multi_req TYPE abap_bool,
model_name TYPE string,
END OF ty_s_event_control.
ENDINTERFACE.