Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/01/02/z2ui6_cl_core_action.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ CLASS z2ui6_cl_core_action IMPLEMENTATION.

CATCH cx_root INTO DATA(x).
RAISE EXCEPTION TYPE z2ui6_cx_util_error
EXPORTING val = |App with name { mo_http_post->ms_request-s_control-app_start } not found...|
previous = x.
EXPORTING
val = |App with name { mo_http_post->ms_request-s_control-app_start } not found...|
previous = x.
ENDTRY.

ENDMETHOD.
Expand Down Expand Up @@ -166,10 +167,9 @@ CLASS z2ui6_cl_core_action IMPLEMENTATION.
result->ms_next-s_set-s_popover-check_update_model = abap_false.

IF ms_next-s_set-s_follow_up_action IS NOT INITIAL.
" .eB(['POPUP_CONFIRM'])
" TODO: variable is assigned but never used (ABAP cleaner)
SPLIT ms_next-s_set-s_follow_up_action-custom_js AT `.eB(['` INTO DATA(lv_dummy)
result->ms_actual-event.
DATA(lv_action) = ms_next-s_set-s_follow_up_action-custom_js[ 1 ].
SPLIT lv_action AT `.eB(['` INTO DATA(lv_dummy)
result->ms_actual-event.
SPLIT result->ms_actual-event AT `']` INTO result->ms_actual-event lv_dummy.
ENDIF.
result->ms_actual-r_data = ms_next-r_data.
Expand Down
18 changes: 13 additions & 5 deletions src/01/02/z2ui6_cl_core_client.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ CLASS z2ui6_cl_core_client IMPLEMENTATION.

METHOD z2ui6_if_client~follow_up_action.

mo_action->ms_next-s_set-s_follow_up_action-custom_js = val.
* mo_action->ms_next-s_set-s_follow_up_action-custom_js = val.
insert val into table mo_action->ms_next-s_set-s_follow_up_action-custom_js.

ENDMETHOD.

Expand Down Expand Up @@ -291,6 +292,7 @@ CLASS z2ui6_cl_core_client IMPLEMENTATION.
METHOD z2ui6_if_client~view_display.

mo_action->ms_next-s_set-s_view-xml = val.
mo_action->ms_next-s_set-s_view-switchDefaultModel = switchDefaultModel.

ENDMETHOD.

Expand All @@ -309,7 +311,10 @@ CLASS z2ui6_cl_core_client IMPLEMENTATION.
custom_filter = custom_filter
custom_mapper = custom_mapper
tab = z2ui6_cl_util=>conv_get_as_data_ref( tab )
tab_index = tab_index ) ).
tab_index = tab_index
switchDefaultModel = switchDefaultModel ) ).



ENDMETHOD.

Expand All @@ -324,7 +329,8 @@ CLASS z2ui6_cl_core_client IMPLEMENTATION.
custom_mapper = custom_mapper
custom_mapper_back = custom_mapper_back
tab = z2ui6_cl_util=>conv_get_as_data_ref( tab )
tab_index = tab_index ) ).
tab_index = tab_index
switchDefaultModel = switchDefaultModel ) ).

ENDMETHOD.

Expand All @@ -334,7 +340,8 @@ CLASS z2ui6_cl_core_client IMPLEMENTATION.
result = lo_bind->main_local( val = val
config = VALUE #( path_only = path
custom_mapper = custom_mapper
custom_filter = custom_filter ) ).
custom_filter = custom_filter
switchDefaultModel = switchDefaultModel ) ).

ENDMETHOD.

Expand Down Expand Up @@ -365,7 +372,8 @@ CLASS z2ui6_cl_core_client IMPLEMENTATION.
DATA(lv_check_sticky) = CAST z2ui6_if_app( mo_action->mo_app->mo_app )->check_sticky.
IF lv_check_sticky = abap_true AND stateful = abap_true.
RAISE EXCEPTION TYPE z2ui6_cx_util_error
EXPORTING val = `STATEFUL_ALREADY_ACTIVATED_ERROR`.
EXPORTING
val = `STATEFUL_ALREADY_ACTIVATED_ERROR`.
ENDIF.
IF stateful = abap_true.
mo_action->ms_next-s_set-s_stateful-active = 1.
Expand Down
26 changes: 20 additions & 6 deletions src/01/02/z2ui6_cl_core_srv_bind.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ CLASS z2ui6_cl_core_srv_bind IMPLEMENTATION.

IF mr_attri->bind_type <> mv_type.
RAISE EXCEPTION TYPE z2ui6_cx_util_error
EXPORTING val = |<p>Binding Error - Two different binding types for same attribute used ({ mr_attri->name }).|.
EXPORTING
val = |<p>Binding Error - Two different binding types for same attribute used ({ mr_attri->name }).|.
ENDIF.

IF mr_attri->custom_mapper IS BOUND.
Expand All @@ -106,18 +107,21 @@ CLASS z2ui6_cl_core_srv_bind IMPLEMENTATION.
DATA(lv_name2) = z2ui6_cl_util=>rtti_get_classname_by_ref( ms_config-custom_mapper ).
IF lv_name1 <> lv_name2.
RAISE EXCEPTION TYPE z2ui6_cx_util_error
EXPORTING val = |<p>Binding Error - Two different mapper for same attribute used ({ mr_attri->name }).|.
EXPORTING
val = |<p>Binding Error - Two different mapper for same attribute used ({ mr_attri->name }).|.
ENDIF.
ENDIF.

IF mr_attri->custom_mapper_back IS BOUND AND mr_attri->custom_mapper_back <> ms_config-custom_mapper_back.
RAISE EXCEPTION TYPE z2ui6_cx_util_error
EXPORTING val = |<p>Binding Error - Two different mapper back for same attribute used ({ mr_attri->name }).|.
EXPORTING
val = |<p>Binding Error - Two different mapper back for same attribute used ({ mr_attri->name }).|.
ENDIF.

IF mr_attri->custom_filter IS BOUND AND mr_attri->custom_filter <> ms_config-custom_filter.
RAISE EXCEPTION TYPE z2ui6_cx_util_error
EXPORTING val = |<p>Binding Error - Two different filter for same attribute used ({ mr_attri->name }).|.
EXPORTING
val = |<p>Binding Error - Two different filter for same attribute used ({ mr_attri->name }).|.
ENDIF.

ENDMETHOD.
Expand All @@ -129,7 +133,8 @@ CLASS z2ui6_cl_core_srv_bind IMPLEMENTATION.
DATA(lo_dummy) = CAST if_serializable_object( mr_attri->custom_filter_back ) ##NEEDED.
CATCH cx_root.
RAISE EXCEPTION TYPE z2ui6_cx_util_error
EXPORTING val = `<p>custom_filter_back used but it is not serializable, please use if_serializable_object`.
EXPORTING
val = `<p>custom_filter_back used but it is not serializable, please use if_serializable_object`.

ENDTRY.
ENDIF.
Expand Down Expand Up @@ -220,8 +225,13 @@ CLASS z2ui6_cl_core_srv_bind IMPLEMENTATION.

IF |/{ z2ui6_if_core_types=>cs_ui5-two_way_model }| = result.
RAISE EXCEPTION TYPE z2ui6_cx_util_error
EXPORTING val = `<p>Name of variable not allowed - x is reserved word - use anoter name for your attribute`.
EXPORTING
val = `<p>Name of variable not allowed - x is reserved word - use anoter name for your attribute`.

ENDIF.

IF ms_config-switchdefaultmodel = abap_true.
result = |http>{ result }|.
ENDIF.

IF ms_config-path_only = abap_false.
Expand Down Expand Up @@ -277,6 +287,10 @@ CLASS z2ui6_cl_core_srv_bind IMPLEMENTATION.

result = |/{ lv_id }|.

IF ms_config-switchdefaultmodel = abap_true.
result = |http>{ result }|.
ENDIF.

IF config-path_only = abap_false.
result = |\{{ result }\}|.
ENDIF.
Expand Down
4 changes: 3 additions & 1 deletion src/01/02/z2ui6_if_core_types.intf.abap
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ INTERFACE z2ui6_if_core_types
custom_filter_back TYPE REF TO z2ui6_if_ajson_filter,
tab TYPE REF TO data,
tab_index TYPE i,
switchDefaultModel TYPE abap_bool,
END OF ty_s_bind_config.

TYPES:
Expand All @@ -67,6 +68,7 @@ INTERFACE z2ui6_if_core_types
BEGIN OF ty_s_next_frontend,
BEGIN OF s_view,
xml TYPE string,
switchDefaultModel TYPE string,
check_destroy TYPE abap_bool,
check_update_model TYPE abap_bool,
END OF s_view,
Expand Down Expand Up @@ -130,7 +132,7 @@ INTERFACE z2ui6_if_core_types
closeonbrowsernavigation TYPE string,
END OF s_msg_toast,
BEGIN OF s_follow_up_action,
custom_js TYPE string,
custom_js TYPE string_table,
END OF s_follow_up_action,
* handler_attrs TYPE ty_s_http_handler_attributes,
s_stateful TYPE ty_s_http_res-s_stateful,
Expand Down
7 changes: 4 additions & 3 deletions src/01/03/z2ui6_cl_app_app_js.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ CLASS z2ui6_cl_app_app_js IMPLEMENTATION.
`` && |\n| &&
` onInit: async function () {` && |\n| &&
`` && |\n| &&
` z2ui5.oConfig.pathname = this.getView().getModel().sServiceUrl;` && |\n| &&
` z2ui5.oOwnerComponent = this.getOwnerComponent();` && |\n| &&
` z2ui5.oConfig.pathname = this.getView().getModel("http").sServiceUrl;` && |\n| &&
` if (z2ui5?.checkLocal == true ) {` && |\n| &&
` z2ui5.oConfig.pathname = window.location.href;` && |\n| &&
` };` && |\n| &&
`` && |\n| &&
` z2ui5.oController = new Controller();` && |\n| &&
` z2ui5.oController.setApp(this.getView().byId("app"));` && |\n| &&
` z2ui5.oApp = this.getView().byId("app");` && |\n| &&
`` && |\n| &&
` z2ui5.oControllerNest = new Controller();` && |\n| &&
` z2ui5.oControllerNest2 = new Controller();` && |\n| &&
Expand Down Expand Up @@ -517,9 +518,9 @@ CLASS z2ui6_cl_app_app_js IMPLEMENTATION.
` var file = z2ui5.oUpload.oFileUpload.files[0];` && |\n| &&
` var reader = new FileReader();` && |\n| &&
`` && |\n| &&
` reader.onload = function (evt) {` && |\n| &&
|\n|.
result = result &&
` reader.onload = function (evt) {` && |\n| &&
` var vContent = evt.currentTarget.result;` && |\n| &&
` this.setProperty("value", vContent);` && |\n| &&
` this.fireUpload();` && |\n| &&
Expand Down
3 changes: 2 additions & 1 deletion src/01/03/z2ui6_cl_app_component_js.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ CLASS z2ui6_cl_app_component_js IMPLEMENTATION.
` }` && |\n| &&
` this.getRouter().initialize();` && |\n| &&
` z2ui5.oRouter = this.getRouter();` && |\n| &&
` this.setModel(Models.createDeviceModel(), "device");` && |\n| &&
` z2ui5.oDeviceModel = Models.createDeviceModel();` && |\n| &&
` this.setModel(z2ui5.oDeviceModel, "device");` && |\n| &&
`` && |\n| &&
` z2ui5.oConfig = {};` && |\n| &&
` z2ui5.oConfig.ComponentData = this.getComponentData();` && |\n| &&
Expand Down
6 changes: 3 additions & 3 deletions src/01/03/z2ui6_cl_app_manifest_json.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ CLASS z2ui6_cl_app_manifest_json IMPLEMENTATION.
` "toolsId": "3a966e20-9635-4c28-8861-d1b66f79f1de"` &&
` },` &&
` "dataSources": {` &&
` "mainService": {` &&
` "http": {` &&
` "uri": "/sap/bc/z2ui5",` &&
` "type": "OData",` &&
` "settings": {` &&
Expand Down Expand Up @@ -94,8 +94,8 @@ CLASS z2ui6_cl_app_manifest_json IMPLEMENTATION.
` }` &&
` },` &&
` "models": {` &&
` "": {` &&
` "dataSource": "mainService",` &&
` "http": {` &&
` "dataSource": "http",` &&
` "preload": true,` &&
` "settings": {}` &&
` }` &&
Expand Down
4 changes: 3 additions & 1 deletion src/01/03/z2ui6_cl_app_server_js.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,15 @@ CLASS z2ui6_cl_app_server_js IMPLEMENTATION.
` }` && |\n| &&
` ; if (z2ui5.oResponse.PARAMS?.S_FOLLOW_UP_ACTION?.CUSTOM_JS) {` && |\n| &&
` setTimeout(() => {` && |\n| &&
` let mParams = z2ui5.oResponse?.PARAMS.S_FOLLOW_UP_ACTION.CUSTOM_JS.split("'");` && |\n| &&
` for ( let i = 0; i < z2ui5.oResponse?.PARAMS.S_FOLLOW_UP_ACTION.CUSTOM_JS.length ; i++ ){` && |\n| &&
` let mParams = z2ui5.oResponse?.PARAMS.S_FOLLOW_UP_ACTION.CUSTOM_JS[i].split("'");` && |\n| &&
` let mParamsEF = mParams.filter((val, index) => index % 2)` && |\n| &&
` if (mParamsEF.length) {` && |\n| &&
` z2ui5.oController.eF.apply(undefined, mParamsEF);` && |\n| &&
` } else {` && |\n| &&
` Function("return " + mParams[0])();` && |\n| &&
` }` && |\n| &&
` }` && |\n| &&
` }, 100);` && |\n| &&
` };` && |\n| &&
` z2ui5.oController.showMessage('S_MSG_TOAST', z2ui5.oResponse.PARAMS);` && |\n| &&
Expand Down
Loading