diff --git a/changelog.txt b/changelog.txt index afb4bc63..5b62bf15 100644 --- a/changelog.txt +++ b/changelog.txt @@ -8,6 +8,18 @@ Legend + : added - : removed + +2024-09-22 v1.134.0 +------------------- + ++ Tile Controls ++ Color Control ++ Multiselect Feature for Popup to Select ++ Data Loss Feature +* Separated Custom Controls & Layouts from abap2UI5 Core +* Multiple Bugfixes and new Properties added + + 2024-08-24 v1.133.0 ------------------- diff --git a/src/01/00/02/z2ui5_cl_abap_api.clas.abap b/src/01/00/02/z2ui5_cl_abap_api.clas.abap index bbb28974..6c4bca93 100644 --- a/src/01/00/02/z2ui5_cl_abap_api.clas.abap +++ b/src/01/00/02/z2ui5_cl_abap_api.clas.abap @@ -207,7 +207,7 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. TYPES fixvalues TYPE STANDARD TABLE OF fixvalue WITH EMPTY KEY. DATA lt_values TYPE fixvalues. - DATA(lv_langu) = ``. + DATA(lv_langu) = ' '. lv_langu = langu. CALL METHOD elemdescr->('GET_DDIC_FIXED_VALUES') @@ -759,6 +759,12 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. RETURN. ENDIF. + IF tabname IS INITIAL. + RAISE EXCEPTION TYPE z2ui5_cx_util_error + EXPORTING + val = `RTTI_BY_NAME_TAB_INITIAL`. + ENDIF. + structdescr ?= cl_abap_structdescr=>describe_by_name( tabname ). = structdescr->get_ddic_field_list( ). diff --git a/src/01/00/03/z2ui5_cl_util.clas.abap b/src/01/00/03/z2ui5_cl_util.clas.abap index 43db550b..90fd31ba 100644 --- a/src/01/00/03/z2ui5_cl_util.clas.abap +++ b/src/01/00/03/z2ui5_cl_util.clas.abap @@ -141,6 +141,13 @@ CLASS z2ui5_cl_util DEFINITION RETURNING VALUE(result) TYPE ty_t_filter_multi. + CLASS-METHODS filter_get_sql_where + IMPORTING + val TYPE z2ui5_cl_util=>ty_t_filter_multi + RETURNING + VALUE(result) TYPE string. + + CLASS-METHODS filter_get_sql_by_sql_string IMPORTING val TYPE clike @@ -768,8 +775,8 @@ CLASS z2ui5_cl_util IMPLEMENTATION. CLEAR lr_filter->t_token_removed. CLEAR lr_filter->t_token_added. - data(lt_token) = result[ name = name ]-t_token. - data(lt_range) = z2ui5_cl_util=>filter_get_range_t_by_token_t( result[ name = name ]-t_token ). + DATA(lt_token) = result[ name = name ]-t_token. + DATA(lt_range) = z2ui5_cl_util=>filter_get_range_t_by_token_t( result[ name = name ]-t_token ). lr_filter->t_range = lt_range. ENDMETHOD. @@ -1436,6 +1443,11 @@ CLASS z2ui5_cl_util IMPLEMENTATION. METHOD rtti_get_t_attri_by_table_name. + IF table_name IS INITIAL. + RAISE EXCEPTION TYPE z2ui5_cx_util_error + EXPORTING + val = 'TABLE_NAME_INITIAL_ERROR'. + ENDIF. TRY. DATA(lo_struct) = CAST cl_abap_structdescr( cl_abap_structdescr=>describe_by_name( table_name ) ). CATCH cx_root. @@ -1494,4 +1506,19 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. + METHOD filter_get_sql_where. + + LOOP AT val INTO DATA(ls_filter). + + DATA lo_range TYPE REF TO lcl_range_to_sql. + + CREATE OBJECT lo_range + EXPORTING + iv_fieldname = ls_filter-name + ir_range = REF #( ls_filter-t_range ). + + ENDLOOP. + + ENDMETHOD. + ENDCLASS. diff --git a/src/01/00/03/z2ui5_cl_util.clas.locals_imp.abap b/src/01/00/03/z2ui5_cl_util.clas.locals_imp.abap new file mode 100644 index 00000000..3ecd77ff --- /dev/null +++ b/src/01/00/03/z2ui5_cl_util.clas.locals_imp.abap @@ -0,0 +1,122 @@ +CLASS lcl_range_to_sql DEFINITION + FINAL CREATE PUBLIC. + + PUBLIC SECTION. + + CONSTANTS: BEGIN OF signs, + including TYPE string VALUE 'I', + excluding TYPE string VALUE 'E', + END OF signs. + + CONSTANTS: BEGIN OF options, + equal TYPE string VALUE 'EQ', + not_equal TYPE string VALUE 'NE', + between TYPE string VALUE 'BT', + not_between TYPE string VALUE 'NB', + contains_pattern TYPE string VALUE 'CP', + not_contains_pattern TYPE string VALUE 'NP', + greater_than TYPE string VALUE 'GT', + greater_equal TYPE string VALUE 'GE', + less_equal TYPE string VALUE 'LE', + less_than TYPE string VALUE 'LT', + END OF options. + + METHODS constructor + IMPORTING + iv_fieldname TYPE clike + ir_range TYPE REF TO data. + + METHODS get_sql + RETURNING + VALUE(result) TYPE string. + + PROTECTED SECTION. + DATA mv_fieldname TYPE string. + DATA mr_range TYPE REF TO data. + + CLASS-METHODS quote + IMPORTING + val TYPE clike + RETURNING + VALUE(out) TYPE string. + + + +ENDCLASS. + + +CLASS lcl_range_to_sql IMPLEMENTATION. + + METHOD constructor. + + mr_range = ir_range. + mv_fieldname = |{ to_upper( iv_fieldname ) }|. + + ENDMETHOD. + + METHOD get_sql. + + FIELD-SYMBOLS TYPE STANDARD TABLE. + + ASSIGN me->mr_range->* TO . + + IF xsdbool( IS INITIAL ) = abap_true. + RETURN. + ENDIF. + + result = `(`. + + LOOP AT ASSIGNING FIELD-SYMBOL(). + + ASSIGN COMPONENT 'SIGN' OF STRUCTURE TO FIELD-SYMBOL(). + ASSIGN COMPONENT 'OPTION' OF STRUCTURE TO FIELD-SYMBOL(). + ASSIGN COMPONENT 'LOW' OF STRUCTURE TO FIELD-SYMBOL(). + ASSIGN COMPONENT 'HIGH' OF STRUCTURE TO FIELD-SYMBOL(). + + IF sy-tabix <> 1. + result = |{ result } OR|. + ENDIF. + + IF = signs-excluding. + result = |{ result } NOT|. + ENDIF. + + result = |{ result } { me->mv_fieldname }|. + + CASE . + WHEN options-equal OR + options-not_equal OR + options-greater_than OR + options-greater_equal OR + options-less_equal OR + options-less_than. + result = |{ result } { } { quote( ) }|. + + WHEN options-between. + result = |{ result } BETWEEN { quote( ) } AND { quote( ) }|. + + WHEN options-not_between. + result = |{ result } NOT BETWEEN { quote( ) } AND { quote( ) }|. + + WHEN options-contains_pattern. + TRANSLATE USING '*%'. + result = |{ result } LIKE { quote( ) }|. + + WHEN options-not_contains_pattern. + TRANSLATE USING '*%'. + result = |{ result } NOT LIKE { quote( ) }|. + ENDCASE. + ENDLOOP. + + result = |{ result } )|. + + ENDMETHOD. + + METHOD quote. + out = |'{ replace( val = val + sub = `'` + with = `''` + occ = 0 ) }'|. + ENDMETHOD. + +ENDCLASS. diff --git a/src/01/01/z2ui5_cl_core_attri_srv.clas.abap b/src/01/01/z2ui5_cl_core_attri_srv.clas.abap index f6bbf4a5..fb420cec 100644 --- a/src/01/01/z2ui5_cl_core_attri_srv.clas.abap +++ b/src/01/01/z2ui5_cl_core_attri_srv.clas.abap @@ -184,6 +184,15 @@ CLASS z2ui5_cl_core_attri_srv IMPLEMENTATION. TRY. lr_attri->r_ref = attri_get_val_ref( lr_attri->name ). lr_attri->o_typedescr = cl_abap_datadescr=>describe_by_data_ref( lr_attri->r_ref ). + +* TRY. +* CAST cl_abap_refdescr( lr_attri->o_typedescr ). +* IF lr_attri->r_ref IS INITIAL. +* DELETE mt_attri->*. +* ENDIF. +* CATCH cx_root. +* ENDTRY. + CATCH cx_root. ENDTRY. ENDLOOP. diff --git a/src/01/01/z2ui5_cl_core_json_srv.clas.abap b/src/01/01/z2ui5_cl_core_json_srv.clas.abap index ced9b76e..26b42647 100644 --- a/src/01/01/z2ui5_cl_core_json_srv.clas.abap +++ b/src/01/01/z2ui5_cl_core_json_srv.clas.abap @@ -67,6 +67,9 @@ CLASS z2ui5_cl_core_json_srv IMPLEMENTATION. ENDIF. ASSIGN lr_attri->r_ref->* TO FIELD-SYMBOL(). + IF sy-subrc <> 0. + CONTINUE. + ENDIF. lo_val_front->to_abap( IMPORTING @@ -98,7 +101,10 @@ CLASS z2ui5_cl_core_json_srv IMPLEMENTATION. OR z2ui5_if_core_types=>cs_bind_type-two_way. ASSIGN lr_attri->r_ref->* TO FIELD-SYMBOL(). - ASSERT sy-subrc = 0. + IF sy-subrc <> 0. + CONTINUE. + ENDIF. +* ASSERT sy-subrc = 0. ajson->set( iv_ignore_empty = abap_false iv_path = `/` iv_val = ). WHEN z2ui5_if_core_types=>cs_bind_type-one_time. diff --git a/src/01/02/z2ui5_cl_core_app.clas.abap b/src/01/02/z2ui5_cl_core_app.clas.abap index fe1e929d..24ce62e1 100644 --- a/src/01/02/z2ui5_cl_core_app.clas.abap +++ b/src/01/02/z2ui5_cl_core_app.clas.abap @@ -95,11 +95,11 @@ CLASS z2ui5_cl_core_app IMPLEMENTATION. result = z2ui5_cl_util=>xml_stringify( me ). - CATCH cx_root. + CATCH cx_root INTO DATA(cx). RAISE EXCEPTION TYPE z2ui5_cx_util_error EXPORTING - val = `

` && x2->get_text( ) && ` or

Please check if all generic data references are public attributes of your class`. + val = `

` && cx->get_text( ) && `

` && x2->get_text( ) && ` or

Please check if all generic data references are public attributes of your class`. ENDTRY. ENDTRY. diff --git a/src/01/02/z2ui5_cl_core_client.clas.abap b/src/01/02/z2ui5_cl_core_client.clas.abap index 2a7d200b..eff41aae 100644 --- a/src/01/02/z2ui5_cl_core_client.clas.abap +++ b/src/01/02/z2ui5_cl_core_client.clas.abap @@ -64,6 +64,11 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. ENDMETHOD. + METHOD z2ui5_if_client~get_event_args. + + result = mo_action->ms_actual-t_event_arg[ v ]. + + ENDMETHOD. METHOD z2ui5_if_client~get_app. @@ -167,7 +172,6 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. mo_action->ms_next-s_set-s_view_nest2-id = id. mo_action->ms_next-s_set-s_view_nest2-method_destroy = method_destroy. mo_action->ms_next-s_set-s_view_nest2-method_insert = method_insert. - mo_action->ms_next-s_set-s_view_nest2-s_config = s_config. ENDMETHOD. @@ -192,7 +196,6 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. mo_action->ms_next-s_set-s_view_nest-id = id. mo_action->ms_next-s_set-s_view_nest-method_destroy = method_destroy. mo_action->ms_next-s_set-s_view_nest-method_insert = method_insert. - mo_action->ms_next-s_set-s_view_nest-s_config = s_config. ENDMETHOD. @@ -216,7 +219,6 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. mo_action->ms_next-s_set-s_popover-check_destroy = abap_false. mo_action->ms_next-s_set-s_popover-xml = xml. mo_action->ms_next-s_set-s_popover-open_by_id = by_id. - mo_action->ms_next-s_set-s_popover-s_config = s_config. ENDMETHOD. @@ -239,7 +241,6 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. mo_action->ms_next-s_set-s_popup-check_destroy = abap_false. mo_action->ms_next-s_set-s_popup-xml = val. - mo_action->ms_next-s_set-s_popup-s_config = s_config. ENDMETHOD. @@ -261,7 +262,6 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. METHOD z2ui5_if_client~view_display. mo_action->ms_next-s_set-s_view-xml = val. - mo_action->ms_next-s_set-s_view-s_config = s_config. ENDMETHOD. @@ -343,6 +343,12 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. METHOD z2ui5_if_client~set_session_stateful. + DATA(lv_check_sticky) = CAST z2ui5_if_app( mo_action->mo_app->mo_app )->check_sticky. + IF lv_check_sticky = abap_true AND stateful = abap_true. + RAISE EXCEPTION TYPE z2ui5_cx_util_error + EXPORTING + val = `STATEFUL_ALREADY_ACTIVATED_ERROR`. + ENDIF. IF stateful = abap_true. mo_action->ms_next-s_set-handler_attrs-stateful-active = 1. CAST z2ui5_if_app( mo_action->mo_app->mo_app )->check_sticky = abap_true. diff --git a/src/01/02/z2ui5_cl_core_http_get.clas.abap b/src/01/02/z2ui5_cl_core_http_get.clas.abap index 9f0f496e..885a364c 100644 --- a/src/01/02/z2ui5_cl_core_http_get.clas.abap +++ b/src/01/02/z2ui5_cl_core_http_get.clas.abap @@ -15,12 +15,6 @@ CLASS z2ui5_cl_core_http_get DEFINITION RETURNING VALUE(result) TYPE string. - METHODS get_js -* IMPORTING -* cs_config TYPE z2ui5_if_types=>ty_s_http_request_get - RETURNING - VALUE(result) TYPE string. - METHODS get_js_cc_startup RETURNING VALUE(result) TYPE string. @@ -37,13 +31,11 @@ CLASS z2ui5_cl_core_http_get DEFINITION METHODS main_get_index_html IMPORTING - cs_config TYPE z2ui5_if_types=>ty_s_http_request_get - RETURNING VALUE(result) TYPE string. - - METHODS main_get_component_script + cs_config TYPE z2ui5_if_types=>ty_s_http_request_get RETURNING VALUE(result) TYPE string. + PRIVATE SECTION. ENDCLASS. @@ -65,31 +57,17 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION. `ui5.sap.com *.ui5.sap.com sapui5.hana.ondemand.com *.sapui5.hana.ondemand.com openui5.hana.ondemand.com *.openui5.hana.ondemand.com ` && `sdk.openui5.org *.sdk.openui5.org cdn.jsdelivr.net *.cdn.jsdelivr.net cdnjs.cloudflare.com *.cdnjs.cloudflare.com schemas *.schemas"/>`. - DATA(lv_style) = ` html, body, body > div, #container, #container-uiarea {` && |\n| && - ` height: 100%;` && |\n| && - ` }` && |\n| && - ` .dbg-ltr {` && |\n| && - ` direction: ltr !important;` && |\n| && - ` }`. - result = VALUE #( t_param = VALUE #( - ( n = `TITLE` v = `abap2UI5` ) - ( n = `STYLE` v = lv_style ) - ( n = `SET_SIZE_LIMIT` v = `100` ) - ( n = `BODY_CLASS` v = `sapUiBody sapUiSizeCompact` ) + ( n = `TITLE` v = `abap2UI5` ) + ( n = `SET_SIZE_LIMIT` v = `100` ) ) t_config = VALUE #( - ( n = `src` v = `https://sdk.openui5.org/resources/sap-ui-cachebuster/sap-ui-core.js` ) -* ( n = `src` v = `https://sdk.openui5.org/nightly/2/resources/sap-ui-core.js` ) - ( n = `data-sap-ui-theme` v = `sap_horizon` ) - ( n = `data-sap-ui-async` v = `true` ) - ( n = `id` v = `sap-ui-bootstrap` ) - ( n = `data-sap-ui-bindingSyntax` v = `complex` ) - ( n = `data-sap-ui-frameOptions` v = `trusted` ) - ( n = `data-sap-ui-compatVersion` v = `edge` ) - ( n = `data-sap-ui-resourceroots` v = `{"z2ui5": "./"}` ) - ( n = `data-sap-ui-oninit` v = `onInitComponent` ) ) +* ( n = `src` v = `https://sdk.openui5.org/1.71.67/resources/sap-ui-core.js` ) + ( n = `src` v = `https://sdk.openui5.org/resources/sap-ui-cachebuster/sap-ui-core.js` ) +* ( n = `src` v = `https://sdk.openui5.org/nightly/2/resources/sap-ui-core.js` ) + ( n = `data-sap-ui-theme` v = `sap_horizon` ) + ) content_security_policy = lv_csp ). ENDMETHOD. @@ -112,6 +90,7 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION. z2ui5_cl_cc_util=>get_js( ) && z2ui5_cl_cc_favicon=>get_js( ) && z2ui5_cl_cc_dirty=>get_js( ) && + z2ui5_cl_cc_debug_tool=>get_js( ) && ` `. ENDMETHOD. @@ -149,6 +128,9 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION. METHOD main_get_index_html. + + DATA(lv_add_js) = get_js_cc_startup( ) && cs_config-custom_js. + result = `` && |\n| && `` && |\n| && `` && |\n| && @@ -156,10 +138,30 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION. ` ` && |\n| && ` ` && |\n| && ` ` && |\n| && - | { cs_config-t_param[ n = `TITLE` ]-v } \n| && - | \n| && - main_get_component_script( ) && |\n| && - ` ` && |\n| && + `` && |\n| && `` && |\n| && - `

` && |\n| && - `` && |\n|. - - DATA(lv_add_js) = get_js_cc_startup( ) && cs_config-custom_js. - result = result && - | |. + `
` && |\n| && + ` `. ENDMETHOD. @@ -193,533 +184,4 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION. ENDMETHOD. - METHOD get_js. - - DATA(lv_two_way_model) = z2ui5_if_core_types=>cs_ui5-two_way_model. - - result = ` if (!z2ui5.Controller) { ` && - `sap.ui.define("z2ui5/Controller", ["sap/ui/core/mvc/Controller", "sap/ui/core/mvc/XMLView", "sap/ui/model/json/JSONModel", "sap/ui/core/BusyIndicator", "sap/m/MessageBox", "sap/m/MessageToast", "sap/ui/core/Fragment", "sap/m/BusyDialog` && -`", "sap/ui/VersionInfo" ], function(Control` && - `ler, XMLView, JSONModel, BusyIndicator, MessageBox, MessageToast, Fragment, mBusyDialog, VersionInfo ) {` && |\n| && - ` "use strict";` && |\n| && - ` return Controller.extend("z2ui5.Controller", {` && |\n| && - ` async onAfterRendering() {` && |\n| && - ` try{` && |\n| && - ` if (!sap.z2ui5.oResponse.PARAMS) {` && |\n| && - ` BusyIndicator.hide();` && |\n| && - ` sap.z2ui5.isBusy = false;` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` const {S_POPUP, S_VIEW_NEST, S_VIEW_NEST2, S_POPOVER} = sap.z2ui5.oResponse.PARAMS;` && |\n| && - ` if (S_POPUP?.CHECK_DESTROY) {` && |\n| && - ` sap.z2ui5.oController.PopupDestroy();` && |\n| && - ` }` && |\n| && - ` if (S_POPOVER?.CHECK_DESTROY) {` && |\n| && - ` sap.z2ui5.oController.PopoverDestroy();` && |\n| && - ` }` && |\n| && - ` if (S_POPUP?.XML) {` && |\n| && - ` sap.z2ui5.oController.PopupDestroy();` && |\n| && - ` await this.displayFragment(S_POPUP.XML, 'oViewPopup');` && |\n| && - ` }` && |\n| && - ` if (!sap.z2ui5.checkNestAfter) {` && |\n| && - ` if (S_VIEW_NEST?.XML) {` && |\n| && - ` sap.z2ui5.oController.NestViewDestroy();` && |\n| && - ` await this.displayNestedView(S_VIEW_NEST.XML, 'oViewNest', 'S_VIEW_NEST');` && |\n| && - ` sap.z2ui5.checkNestAfter = true;` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` if (!sap.z2ui5.checkNestAfter2) {` && |\n| && - ` if (S_VIEW_NEST2?.XML) {` && |\n| && - ` sap.z2ui5.oController.NestViewDestroy2();` && |\n| && - ` await this.displayNestedView2(S_VIEW_NEST2.XML, 'oViewNest2', 'S_VIEW_NEST2');` && |\n| && - ` sap.z2ui5.checkNestAfter2 = true;` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` if (S_POPOVER?.XML) {` && |\n| && - ` await this.displayPopover(S_POPOVER.XML, 'oViewPopover', S_POPOVER.OPEN_BY_ID);` && |\n| && - ` }` && |\n| && - ` BusyIndicator.hide();` && |\n| && - ` sap.z2ui5.isBusy = false;` && |\n| && - ` sap.z2ui5.onAfterRendering.forEach(item=>{` && |\n| && - ` if (item !== undefined) {` && |\n| && - ` item();` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` )` && |\n| && -` }catch(e){BusyIndicator.hide(); sap.z2ui5.isBusy = false; MessageBox.error( e.toLocaleString() , { title : "Unexpected Error Occured - App Terminated" , actions : [ ] , onClose : () => { new mBusyDialog({ text : "Please Restart t` && -`he App" }).open(); } } ) }` && |\n| && - ` },` && |\n| && - |\n| && - ` async displayFragment(xml, viewProp) {` && |\n| && - ` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` const oFragment = await Fragment.load({` && |\n| && - ` definition: xml,` && |\n| && - ` controller: sap.z2ui5.oControllerPopup,` && |\n| && - ` id: "popupId"` && |\n| && - ` });` && |\n| && - ` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && - ` oFragment.setModel(oview_model);` && |\n| && - ` sap.z2ui5[viewProp] = oFragment;` && |\n| && - ` sap.z2ui5[viewProp].Fragment = Fragment;` && |\n| && - ` oFragment.open();` && |\n| && - ` },` && |\n| && - ` async displayPopover(xml, viewProp, openById) {` && |\n| && - ` // let sapUiCore = sap.ui.require('sap/ui/core/Core');` && |\n| && - ` sap.ui.require(["sap/ui/core/Element"], async function(Element) { ` && - ` ` && - ` ` && |\n| && - ` const oFragment = await Fragment.load({` && |\n| && - ` definition: xml,` && |\n| && - ` controller: sap.z2ui5.oControllerPopover,` && |\n| && - ` id: "popoverId"` && |\n| && - ` });` && |\n| && - ` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && - ` oFragment.setModel(oview_model);` && |\n| && - ` sap.z2ui5[viewProp] = oFragment;` && |\n| && - ` sap.z2ui5[viewProp].Fragment = Fragment;` && |\n| && - ` let oControl = {};` && |\n| && - ` if( sap.z2ui5.oView?.byId(openById) ) {` && |\n| && - ` oControl = sap.z2ui5.oView.byId(openById);` && |\n| && - ` } else if ( sap.z2ui5.oViewPopup?.Fragment.byId('popupId',openById) ) {` && |\n| && - ` oControl = sap.z2ui5.oViewPopup.Fragment.byId('popupId',openById);` && |\n| && - ` } else if ( sap.z2ui5.oViewNest?.byId(openById) ) {` && |\n| && - ` oControl = sap.z2ui5.oViewNest.byId(openById);` && |\n| && - ` } else if ( sap.z2ui5.oViewNest2?.byId(openById) ) {` && |\n| && - ` oControl = sap.z2ui5.oViewNest2.byId(openById);` && |\n| && - ` } else {` && |\n| && - ` if(sapUiCore.byId(openById)) {` && |\n| && - ` // oControl = sapUiCore.byId(openById);` && |\n| && - ` oControl = Element.getElementById(openById);` && |\n| && - ` } else {` && |\n| && - ` oControl = null;` && |\n| && - ` };` && |\n| && - ` }` && |\n| && - ` oFragment.openBy(oControl);` && |\n| && - ` }); },` && |\n| && - ` async displayNestedView(xml, viewProp, viewNestId) {` && |\n| && - ` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` const oView = await XMLView.create({` && |\n| && - ` definition: xml,` && |\n| && - ` controller: sap.z2ui5.oControllerNest,` && |\n| && - ` preprocessors: { xml: { models: { template: oview_model } } }` && |\n| && - ` });` && |\n| && - ` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && - ` oView.setModel(oview_model);` && |\n| && - ` let oParent = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS[viewNestId].ID);` && |\n| && - ` if (oParent) {` && |\n| && - ` try {` && |\n| && - ` oParent[sap.z2ui5.oResponse.PARAMS[viewNestId].METHOD_DESTROY]();` && |\n| && - ` } catch {}` && |\n| && - ` oParent[sap.z2ui5.oResponse.PARAMS[viewNestId].METHOD_INSERT](oView);` && |\n| && - ` }` && |\n| && - ` sap.z2ui5[viewProp] = oView;` && |\n| && - ` },` && |\n| && - ` async displayNestedView2(xml, viewProp, viewNestId) {` && |\n| && - ` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` const oView = await XMLView.create({` && |\n| && - ` definition: xml,` && |\n| && - ` controller: sap.z2ui5.oControllerNest2,` && |\n| && - ` preprocessors: { xml: { models: { template: oview_model } } }` && |\n| && - ` });` && |\n| && - ` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && - ` oView.setModel(oview_model);` && |\n| && - ` let oParent = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS[viewNestId].ID);` && |\n| && - ` if (oParent) {` && |\n| && - ` try {` && |\n| && - ` oParent[sap.z2ui5.oResponse.PARAMS[viewNestId].METHOD_DESTROY]();` && |\n| && - ` } catch {}` && |\n| && - ` oParent[sap.z2ui5.oResponse.PARAMS[viewNestId].METHOD_INSERT](oView);` && |\n| && - ` }` && |\n| && - ` sap.z2ui5[viewProp] = oView;` && |\n| && - ` },` && |\n| && - ` PopupDestroy() {` && |\n| && - ` if (!sap.z2ui5.oViewPopup) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` if (sap.z2ui5.oViewPopup.close) {` && |\n| && - ` try {` && |\n| && - ` sap.z2ui5.oViewPopup.close();` && |\n| && - ` } catch {}` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.oViewPopup.destroy();` && |\n| && - ` },` && |\n| && - ` PopoverDestroy() {` && |\n| && - ` if (!sap.z2ui5.oViewPopover) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` if (sap.z2ui5.oViewPopover.close) {` && |\n| && - ` try {` && |\n| && - ` sap.z2ui5.oViewPopover.close();` && |\n| && - ` } catch {}` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.oViewPopover.destroy();` && |\n| && - ` },` && |\n| && - ` NestViewDestroy() {` && |\n| && - ` if (!sap.z2ui5.oViewNest) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.oViewNest.destroy();` && |\n| && - ` },` && |\n| && - ` NestViewDestroy2() {` && |\n| && - ` if (!sap.z2ui5.oViewNest2) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.oViewNest2.destroy();` && |\n| && - ` },` && |\n| && - ` ViewDestroy() {` && |\n| && - ` if (!sap.z2ui5.oView) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.oView.destroy();` && |\n| && - ` },` && |\n| && - ` eF(...args) {` && |\n| && - ` sap.z2ui5.onBeforeEventFrontend.forEach(item => {` && |\n| && - ` if (item !== undefined) {` && |\n| && - ` item(args);` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` )` && |\n| && - ` let oCrossAppNavigator;` && |\n| && - ` switch (args[0]) {` && |\n| && - ` case 'DOWNLOAD_B64_FILE':` && |\n| && - ` var a = document.createElement("a");` && |\n| && - ` a.href = args[1];` && |\n| && - ` a.download = args[2];` && |\n| && - ` a.click();` && |\n| && - ` break;` && |\n| && - ` case 'CROSS_APP_NAV_TO_PREV_APP':` && |\n| && - ` oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");` && |\n| && - ` oCrossAppNavigator.backToPreviousApp();` && |\n| && - ` break;` && |\n| && - ` case 'CROSS_APP_NAV_TO_EXT':` && |\n| && - ` oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");` && |\n| && - ` const hash = (oCrossAppNavigator.hrefForExternal({` && |\n| && - ` target: args[1],` && |\n| && - ` params: args[2]` && |\n| && - ` })) || "";` && |\n| && - ` if (args[3] === 'EXT') {` && |\n| && - ` let url = window.location.href.split('#')[0] + hash;` && |\n| && - ` sap.m.URLHelper.redirect(url, true);` && |\n| && - ` } else {` && |\n| && - ` oCrossAppNavigator.toExternal({` && |\n| && - ` target: {` && |\n| && - ` shellHash: hash` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - ` }` && |\n| && - ` break;` && |\n| && - ` case 'LOCATION_RELOAD':` && |\n| && - ` window.location = args[1];` && |\n| && - ` break;` && |\n| && - ` case 'OPEN_NEW_TAB':` && |\n| && - ` window.open(args[1], '_blank');` && |\n| && - ` break;` && |\n| && - ` case 'POPUP_CLOSE':` && |\n| && - ` sap.z2ui5.oController.PopupDestroy();` && |\n| && - ` break;` && |\n| && - ` case 'POPOVER_CLOSE':` && |\n| && - ` sap.z2ui5.oController.PopoverDestroy();` && |\n| && - ` break;` && |\n| && - ` case 'NAV_CONTAINER_TO':` && |\n| && - ` var navCon = sap.z2ui5.oView.byId(args[1]);` && |\n| && - ` var navConTo = sap.z2ui5.oView.byId(args[2]);` && |\n| && - ` navCon.to(navConTo);` && |\n| && - ` break;` && |\n| && - ` case 'NEST_NAV_CONTAINER_TO':` && |\n| && - ` navCon = sap.z2ui5.oViewNest.byId(args[1]);` && |\n| && - ` navConTo = sap.z2ui5.oViewNest.byId(args[2]);` && |\n| && - ` navCon.to(navConTo);` && |\n| && - ` break;` && |\n| && - ` case 'NEST2_NAV_CONTAINER_TO':` && |\n| && - ` navCon = sap.z2ui5.oViewNest2.byId(args[1]);` && |\n| && - ` navConTo = sap.z2ui5.oViewNest2.byId(args[2]);` && |\n| && - ` navCon.to(navConTo);` && |\n| && - ` break;` && |\n| && - ` case 'POPUP_NAV_CONTAINER_TO':` && |\n| && - ` navCon = Fragment.byId("popupId",args[1]);` && |\n| && - ` navConTo = Fragment.byId("popupId",args[2]);` && |\n| && - ` navCon.to(navConTo);` && |\n| && - ` break;` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` eB(...args) {` && |\n| && - ` if (!window.navigator.onLine) {` && |\n| && - ` MessageBox.alert('No internet connection! Please reconnect to the server and try again.');` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` if (sap.z2ui5.isBusy == true) {` && |\n| && - ` if (!args[0][2]) { ` && |\n| && - ` let oBusyDialog = new mBusyDialog();` && |\n| && - ` oBusyDialog.open();` && |\n| && - ` setTimeout( (oBusyDialog) => { oBusyDialog.close() } , 100 , oBusyDialog );` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.isBusy = true;` && |\n| && - ` BusyIndicator.show();` && |\n| && - ` sap.z2ui5.oBody = {};` && |\n| && - ` if ( args[0][3] ) {` && |\n| && - ` sap.z2ui5.oBody.` && lv_two_way_model && ` = sap.z2ui5.oView.getModel().getData().` && lv_two_way_model && `;` && |\n| && - ` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| && - ` }` && |\n| && - ` else if ( sap.z2ui5.oController == this ) {` && |\n| && - ` sap.z2ui5.oBody.` && lv_two_way_model && ` = sap.z2ui5.oView.getModel().getData().` && lv_two_way_model && `;` && |\n| && - ` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| && - ` }else if ` && |\n| && - ` ( sap.z2ui5.oControllerPopup == this ) {` && |\n| && - ` if (sap.z2ui5.oViewPopup){` && |\n| && - ` sap.z2ui5.oBody.` && lv_two_way_model && ` = sap.z2ui5.oViewPopup.getModel().getData().` && lv_two_way_model && `;` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| && - ` }else if ( ` && |\n| && - ` sap.z2ui5.oControllerPopover == this ) {` && |\n| && - ` sap.z2ui5.oBody.` && lv_two_way_model && ` = sap.z2ui5.oViewPopover.getModel().getData().` && lv_two_way_model && `;` && |\n| && - ` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| && - ` }else if ( ` && |\n| && - ` sap.z2ui5.oControllerNest == this ) {` && |\n| && - ` sap.z2ui5.oBody.` && lv_two_way_model && ` = sap.z2ui5.oViewNest.getModel().getData().` && lv_two_way_model && `;` && |\n| && - ` sap.z2ui5.oBody.VIEWNAME = 'NEST';` && |\n| && - ` }else if (` && |\n| && - ` sap.z2ui5.oControllerNest2 == this ) {` && |\n| && - ` sap.z2ui5.oBody.` && lv_two_way_model && ` = sap.z2ui5.oViewNest2.getModel().getData().` && lv_two_way_model && `;` && |\n| && - ` sap.z2ui5.oBody.VIEWNAME = 'NEST2';` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.onBeforeRoundtrip.forEach(item=>{` && |\n| && - ` if (item !== undefined) {` && |\n| && - ` item();` && |\n| && - ` }})` && |\n| && - ` if (args[0][1]) {` && |\n| && - ` sap.z2ui5.oController.ViewDestroy();` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.oBody.ID = sap.z2ui5.oResponse.ID;` && |\n| && - ` sap.z2ui5.oBody.ARGUMENTS = args;` && |\n| && - ` sap.z2ui5.oBody.ARGUMENTS.forEach( ( item , i ) => { ` && |\n| && - ` if ( i == 0 ) { return; } if ( typeof item === 'object' ){ ` && |\n| && - ` sap.z2ui5.oBody.ARGUMENTS[ i ] = JSON.stringify( item ); ` && |\n| && - ` } ` && |\n| && - ` }); ` && |\n| && - ` sap.z2ui5.oResponseOld = sap.z2ui5.oResponse;` && |\n| && - ` sap.z2ui5.oController.Roundtrip();` && |\n| && - ` },` && |\n| && - ` responseError(response) {` && |\n| && - ` document.write(response);` && |\n| && - ` },` && |\n| && - ` updateModelIfRequired(paramKey, oView) {` && |\n| && - ` if (sap.z2ui5.oResponse.PARAMS == undefined) { return; }` && |\n| && - ` if (sap.z2ui5.oResponse.PARAMS[paramKey]?.CHECK_UPDATE_MODEL) {` && |\n| && - ` let model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && - ` if (oView) { oView.setModel(model); }` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` async responseSuccess(response) {` && |\n| && - ` try{` && |\n| && - ` sap.z2ui5.oResponse = response;` && |\n| && - ` if (sap.z2ui5.oResponse.PARAMS?.S_VIEW?.CHECK_DESTROY) {` && |\n| && - ` sap.z2ui5.oController.ViewDestroy();` && |\n| && - ` };` && |\n| && - ` if(sap.z2ui5.oResponse.PARAMS?.S_FOLLOW_UP_ACTION?.CUSTOM_JS) {` && |\n| && - ` setTimeout(() => {` && |\n| && - ` let mParams = sap.z2ui5.oResponse?.PARAMS.S_FOLLOW_UP_ACTION.CUSTOM_JS.split("'");` && |\n| && - ` let mParamsEF = mParams.filter((val, index) => index % 2)` && |\n| && - ` if(mParamsEF.length) {` && |\n| && - ` sap.z2ui5.oController.eF.apply( undefined , mParamsEF);` && |\n| && - ` } else {` && |\n| && - ` Function("return " + mParams[0])();` && |\n| && - ` }` && |\n| && - ` },100);` && |\n| && - ` };` && |\n| && - |\n| && - ` sap.z2ui5.oController.showMessage('S_MSG_TOAST', sap.z2ui5.oResponse.PARAMS);` && |\n| && - ` sap.z2ui5.oController.showMessage('S_MSG_BOX', sap.z2ui5.oResponse.PARAMS);` && |\n| && - ` if (sap.z2ui5.oResponse.PARAMS?.S_VIEW?.XML) { if ( sap.z2ui5.oResponse.PARAMS?.S_VIEW?.XML !== '') {` && |\n| && - ` sap.z2ui5.oController.ViewDestroy();` && |\n| && - ` await sap.z2ui5.oController.createView(sap.z2ui5.oResponse.PARAMS.S_VIEW.XML, sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` return; } } ` && |\n| && - ` this.updateModelIfRequired('S_VIEW', sap.z2ui5.oView);` && |\n| && - ` this.updateModelIfRequired('S_VIEW_NEST', sap.z2ui5.oViewNest);` && |\n| && - ` this.updateModelIfRequired('S_VIEW_NEST2', sap.z2ui5.oViewNest2);` && |\n| && - ` this.updateModelIfRequired('S_POPUP', sap.z2ui5.oViewPopup);` && |\n| && - ` this.updateModelIfRequired('S_POPOVER', sap.z2ui5.oViewPopover);` && |\n| && - ` sap.z2ui5.oController.onAfterRendering();` && |\n| && - ` }catch(e){BusyIndicator.hide(); if(e.message.includes("openui5")) { if(e.message.includes("script load error")) { sap.z2ui5.oController.checkSDKcompatibility(e) } } else { ` && |\n| && - ` MessageBox.error(e.toLocaleString()); } }` && |\n| && - ` },` && |\n| && - ` async checkSDKcompatibility(err) {` && |\n| && - ` let oCurrentVersionInfo = await VersionInfo.load();` && |\n| && - ` var ui5_sdk = oCurrentVersionInfo.gav.includes('com.sap.ui5') ? true : false;` && |\n| && - ` if(!ui5_sdk) {` && |\n| && - ` if(err) {` && |\n| && - ` MessageBox.error("openui5 SDK is loaded, module: " + err._modules + " is not availabe in openui5" );` && |\n| && - ` return;` && |\n| && - ` };` && |\n| && - ` };` && |\n| && - ` MessageBox.error(err.toLocaleString());` && |\n| && - ` },` && |\n| && - ` showMessage(msgType, params) {` && |\n| && - ` if (params == undefined) { return; }` && |\n| && - ` if (params[msgType]?.TEXT !== undefined) {` && |\n| && - ` if (msgType === 'S_MSG_TOAST') {` && |\n| && - ` MessageToast.show(params[msgType].TEXT,{duration: params[msgType].DURATION ? parseInt(params[msgType].DURATION) : 3000 ,` && |\n| && - ` width: params[msgType].WIDTH ? params[msgType].WIDTH : '15em' ,` && |\n| && - ` onClose: params[msgType].ONCLOSE ? params[msgType].ONCLOSE : null ,` && |\n| && - ` autoClose: params[msgType].AUTOCLOSE ? true : false ,` && |\n| && - ` animationTimingFunction: params[msgType].ANIMATIONTIMINGFUNCTION ? params[msgType].ANIMATIONTIMINGFUNCTION : 'ease' ,` && |\n| && - ` animationDuration: params[msgType].ANIMATIONDURATION ? parseInt(params[msgType].ANIMATIONDURATION) : 1000 ,` && |\n| && - ` closeonBrowserNavigation: params[msgType].CLOSEONBROWSERNAVIGATION ? true : false` && |\n| && - ` });` && |\n| && - ` if(params[msgType].CLASS) {` && |\n| && - ` let mtoast = {};` && |\n| && - ` mtoast = document.getElementsByClassName("sapMMessageToast")[0];` && |\n| && - ` if(mtoast) { mtoast.classList.add(params[msgType].CLASS); }` && |\n| && - ` };` && |\n| && - ` } else if (msgType === 'S_MSG_BOX') {` && |\n| && - ` if (params[msgType].TYPE) {` && |\n| && - ` MessageBox[params[msgType].TYPE](params[msgType].TEXT);` && |\n| && - ` } else {` && |\n| && - ` MessageBox.show(params[msgType].TEXT,{styleClass:params[msgType].STYLECLASS ? params[msgType].STYLECLASS : '',` && |\n| && - ` title: params[msgType].TITLE ? params[msgType].TITLE : '',` && |\n| && - ` onClose: params[msgType].ONCLOSE ? Function("sAction", "return " + params[msgType].ONCLOSE) : null,` && |\n| && - ` actions: params[msgType].ACTIONS ? params[msgType].ACTIONS : 'OK',` && |\n| && - ` emphasizedAction: params[msgType].EMPHASIZEDACTION ? params[msgType].EMPHASIZEDACTION : 'OK',` && |\n| && - ` initialFocus: params[msgType].INITIALFOCUS ? params[msgType].INITIALFOCUS : null,` && |\n| && - ` textDirection: params[msgType].TEXTDIRECTION ? params[msgType].TEXTDIRECTION : 'Inherit',` && |\n| && - ` icon: params[msgType].ICON ? params[msgType].ICON : 'NONE' ,` && |\n| && - ` details: params[msgType].DETAILS ? params[msgType].DETAILS : '',` && |\n| && - ` closeOnNavigation: params[msgType].CLOSEONNAVIGATION ? true : false` && |\n| && - ` }` && |\n| && - ` )` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` async createView(xml, viewModel) {` && |\n| && - ` let oview_model = new JSONModel(viewModel);` && |\n| && - ` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && - ` sap.z2ui5.oView = await XMLView.create({` && |\n| && - ` definition: xml,` && |\n| && - ` models: oview_model,` && |\n| && - ` controller: sap.z2ui5.oController,` && |\n| && - ` id: 'mainView',` && |\n| && - ` preprocessors: { xml: { models: { template: oview_model } } }` && |\n| && - ` });` && |\n| && - ` sap.z2ui5.oView.setModel(sap.z2ui5.oDeviceModel, "device");` && |\n| && - ` if (sap.z2ui5.oParent) {` && |\n| && - ` sap.z2ui5.oParent.removeAllPages();` && |\n| && - ` sap.z2ui5.oParent.insertPage(sap.z2ui5.oView);` && |\n| && - ` } else {` && |\n| && - ` sap.z2ui5.oView.placeAt("container-uiarea");` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` async readHttp() {` && |\n| && - ` const response = await fetch(sap.z2ui5.pathname, {` && |\n| && - ` method: 'POST',` && |\n| && - ` headers: {` && |\n| && - ` 'Content-Type': 'application/json'` && |\n| && - ` },` && |\n| && - ` body: JSON.stringify(sap.z2ui5.oBody)` && |\n| && - ` });` && |\n| && - ` if (!response.ok) {` && |\n| && - ` const responseText = await response.text();` && |\n| && - ` sap.z2ui5.oController.responseError(responseText);` && |\n| && - ` } else {` && |\n| && - ` const responseData = await response.json();` && |\n| && - ` sap.z2ui5.responseData = responseData;` && |\n| && - ` sap.z2ui5.oController.responseSuccess({` && |\n| && - ` ID : responseData.S_FRONT.ID,` && |\n| && - ` PARAMS : responseData.S_FRONT.PARAMS,` && |\n| && - ` OVIEWMODEL : responseData.MODEL,` && |\n| && - ` });` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` Roundtrip() {` && |\n| && - ` sap.z2ui5.checkTimerActive = false;` && |\n| && - ` sap.z2ui5.checkNestAfter = false;` && |\n| && - ` sap.z2ui5.checkNestAfter2 = false;` && |\n| && - ` let event = (args) => { if ( args != undefined ) { return args[0][0]; } };` && |\n| && - ` sap.z2ui5.oBody.S_FRONT = {` && |\n| && - ` ID: sap.z2ui5?.oBody?.ID,` && |\n| && - ` COMPDATA: (sap.z2ui5.ComponentData) ? sap.z2ui5.ComponentData : {} ,` && |\n| && - ` ` && lv_two_way_model && `: sap.z2ui5?.oBody?.` && lv_two_way_model && `,` && |\n| && - ` ORIGIN: window.location.origin,` && |\n| && - ` PATHNAME: window.location.pathname, // sap.z2ui5.pathname,` && |\n| && - ` SEARCH: (sap.z2ui5.search) ? sap.z2ui5.search : window.location.search,` && |\n| && - ` VIEW: sap.z2ui5.oBody?.VIEWNAME,` && |\n| && - ` T_STARTUP_PARAMETERS: sap.z2ui5.startupParameters,` && |\n| && - ` EVENT: event(sap.z2ui5.oBody?.ARGUMENTS),` && |\n| && - ` };` && |\n| && - ` if ( sap.z2ui5.oBody?.ARGUMENTS != undefined ) { if ( sap.z2ui5.oBody?.ARGUMENTS.length > 0 ) { sap.z2ui5.oBody?.ARGUMENTS.shift(); } }` && |\n| && - ` sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG = sap.z2ui5.oBody?.ARGUMENTS;` && |\n| && - ` delete sap.z2ui5.oBody.ID;` && |\n| && - ` delete sap.z2ui5.oBody?.VIEWNAME;` && |\n| && - ` delete sap.z2ui5.oBody?.S_FRONT.` && lv_two_way_model && `;` && |\n| && - ` delete sap.z2ui5.oBody?.ARGUMENTS;` && |\n| && - ` if (!sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG) { delete sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG; } ` && |\n| && - ` if (sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG) { if (sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG.length == 0 ) { delete sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG; } }` && |\n| && - ` if (sap.z2ui5.oBody.S_FRONT.T_STARTUP_PARAMETERS == undefined) { delete sap.z2ui5.oBody.S_FRONT.T_STARTUP_PARAMETERS; } ` && |\n| && - ` if ( sap.z2ui5.oBody.S_FRONT.SEARCH == '' ){ delete sap.z2ui5.oBody.S_FRONT.SEARCH; } ` && |\n| && - ` if (!sap.z2ui5.oBody.` && lv_two_way_model && `){ delete sap.z2ui5.oBody.` && lv_two_way_model && `; } ` && |\n| && - ` sap.z2ui5.oController.readHttp();` && |\n| && - ` },` && |\n| && - ` })` && |\n| && - `}); } ` && |\n| && - `sap.ui.require(["z2ui5/Controller", "sap/ui/core/BusyIndicator", "sap/ui/model/json/JSONModel", "sap/ui/core/mvc/XMLView", "sap/ui/core/Fragment", "sap/m/MessageToast", "sap/m/MessageBox"], (Controller,BusyIndicator, JSONModel)=>{` && - |\n| && - ` BusyIndicator.show();` && |\n| && - ` sap.z2ui5.oController = new Controller();` && |\n| && - ` sap.z2ui5.oControllerNest = new Controller();` && |\n| && - ` sap.z2ui5.oControllerNest2 = new Controller();` && |\n| && - ` sap.z2ui5.oControllerPopup = new Controller();` && |\n| && - ` sap.z2ui5.oControllerPopover = new Controller();` && |\n| && - ` sap.z2ui5.pathname = sap.z2ui5.pathname || window.location.pathname;` && |\n| && - ` sap.z2ui5.checkNestAfter = false;` && |\n| && - ` sap.z2ui5.oBody = { };` && |\n| && - ` sap.z2ui5.oController.Roundtrip();` && |\n| && - ` sap.z2ui5.onBeforeRoundtrip = [];` && |\n| && - ` sap.z2ui5.onAfterRendering = [];` && |\n| && - ` sap.z2ui5.onBeforeEventFrontend = [];` && |\n| && - ` sap.z2ui5.onAfterRoundtrip = []; ` && |\n| && - ` ` && |\n| && - ` }` && |\n| && - `);`. - - ENDMETHOD. - - METHOD main_get_component_script. - result = ``. - ENDMETHOD. ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_http_get.clas.locals_imp.abap b/src/01/02/z2ui5_cl_core_http_get.clas.locals_imp.abap new file mode 100644 index 00000000..0a74d8f5 --- /dev/null +++ b/src/01/02/z2ui5_cl_core_http_get.clas.locals_imp.abap @@ -0,0 +1,795 @@ +CLASS lcl_ui5_app DEFINITION. + + PUBLIC SECTION. + + METHODS controller_app_js + RETURNING + VALUE(result) TYPE string. + + METHODS view_app_xml + RETURNING + VALUE(result) TYPE string. + + METHODS i18n_i18n_properties + RETURNING + VALUE(result) TYPE string. + + METHODS controller_view1_js + RETURNING + VALUE(result) TYPE string. + + METHODS view_view1_xml + RETURNING + VALUE(result) TYPE string. + + METHODS manifest_json + RETURNING + VALUE(result) TYPE string. + + METHODS css_style_css + RETURNING + VALUE(result) TYPE string. + + METHODS component_js + RETURNING + VALUE(result) TYPE string. + + METHODS model_models_js + RETURNING + VALUE(result) TYPE string. + +ENDCLASS. + +CLASS lcl_ui5_app IMPLEMENTATION. + + METHOD component_js. + + result = + | sap.z2ui5 = sap.z2ui5 \|\| \{\} ; if ( typeof z2ui5 == "undefined" ) \{ var z2ui5 = \{\}; \}; \n| && + | sap.z2ui5.pathname = window.location.pathname; | && + `sap.ui.define(["sap/ui/core/UIComponent", "sap/ui/Device" , "z2ui5/model/models" ], function(UIComponent, Device, models) {` && |\n| && + ` return UIComponent.extend("z2ui5.Component", {` && |\n| && + ` metadata: {` && |\n| && + ` manifest: "json"` && |\n| && + ` },` && |\n| && + ` init: function() {` && |\n| && + |\n| && |\n| && + ` UIComponent.prototype.init.apply(this, arguments);` && |\n| && + ` this.getRouter().initialize();` && |\n| && + ` this.setModel(models.createDeviceModel(), "device");` && |\n| && + |\n| && |\n| && + ` sap.z2ui5 = sap.z2ui5 || {};` && |\n| && + ` if (typeof z2ui5 == "undefined") {` && |\n| && + ` var z2ui5 = {};` && |\n| && + ` }` && |\n| && + ` ;sap.z2ui5.pathname = sap.z2ui5.pathname || this.getManifestEntry("/sap.app/dataSources/mainService/uri");` && |\n| && + |\n| && |\n| && + ` if (/iPad|iPhone/.test(navigator.platform)) {` && |\n| && + ` window.addEventListener("pagehide", this.__pagehide.bind(this));` && |\n| && + ` } else {` && |\n| && + ` window.addEventListener("beforeunload", this.__beforeunload.bind(this));` && |\n| && + ` }` && |\n| && + |\n| && |\n| && + ` },` && |\n| && + ` __beforeunload: function() {` && |\n| && + ` window.removeEventListener("__beforeunload", this.__beforeunload.bind(this));` && |\n| && + ` this.destroy();` && |\n| && + ` //manually call destroy as it is only fired in FLP` && |\n| && + ` },` && |\n| && + ` __pagehide: function() {` && |\n| && + ` window.removeEventListener("pagehide", this.__pagehide.bind(this));` && |\n| && + ` this.destroy();` && |\n| && + ` //manually call destroy as it is only fired in FLP` && |\n| && + ` },` && |\n| && + ` exit: function() {` && |\n| && + ` if (sap.z2ui5.contextId) {` && |\n| && + ` fetch(sap.z2ui5.pathname, {` && |\n| && + ` method: 'HEAD',` && |\n| && + ` keepalive: true,` && |\n| && + ` headers: {` && |\n| && + ` 'sap-terminate': 'session',` && |\n| && + ` 'sap-contextid': sap.z2ui5.contextId,` && |\n| && + ` 'sap-contextid-accept': 'header'` && |\n| && + ` }` && |\n| && + ` });` && |\n| && + ` }` && |\n| && + ` if (UIComponent.prototype.exit)` && |\n| && + ` UIComponent.prototype.exit.apply(this, arguments);` && |\n| && + ` },` && |\n| && + ` });` && |\n| && + `});`. + + + ENDMETHOD. + + METHOD controller_app_js. + + result = ` sap.ui.define(["sap/ui/core/mvc/Controller", "z2ui5/controller/View1.controller", "sap/ui/core/BusyIndicator"], function(BaseController, Controller, BusyIndicator){` && |\n| && + ` return BaseController.extend("z2ui5.controller.App", {` && |\n| && + ` onInit: function(){` && |\n| && + ` BusyIndicator.show();` && |\n| && + ` ` && |\n| && + ` sap.z2ui5.oController = new Controller();` && |\n| && + ` sap.z2ui5.oControllerNest = new Controller();` && |\n| && + ` sap.z2ui5.oControllerNest2 = new Controller();` && |\n| && + ` sap.z2ui5.oControllerPopup = new Controller();` && |\n| && + ` sap.z2ui5.oControllerPopover = new Controller();` && |\n| && + ` sap.z2ui5.checkNestAfter = false;` && |\n| && + ` sap.z2ui5.oBody = { };` && |\n| && + ` sap.z2ui5.oController.setApp(this.getView());` && |\n| && + ` sap.z2ui5.oController.Roundtrip();` && |\n| && + ` sap.z2ui5.onBeforeRoundtrip = [];` && |\n| && + ` sap.z2ui5.onAfterRendering = [];` && |\n| && + ` sap.z2ui5.onBeforeEventFrontend = [];` && |\n| && + ` sap.z2ui5.onAfterRoundtrip = []; ` && |\n| && + ` }` && |\n| && + ` });` && |\n| && + ` });`. + + ENDMETHOD. + + METHOD controller_view1_js. + + result = `` && |\n| && +`sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/mvc/XMLView", "sap/ui/model/json/JSONModel", "sap/ui/core/BusyIndicator", "sap/m/MessageBox", "sap/m/MessageToast", "sap/ui/core/Fragment", "sap/m/BusyDialog", "sap/ui/VersionInfo"],` && |\n| && + ` function (Controller, XMLView, JSONModel, BusyIndicator, MessageBox, MessageToast, Fragment, mBusyDialog, VersionInfo) {` && |\n| && + ` "use strict";` && |\n| && + ` return Controller.extend("z2ui5.controller.View1", {` && |\n| && + ` async onAfterRendering() {` && |\n| && + ` try {` && |\n| && + ` if (!sap.z2ui5.oResponse.PARAMS) {` && |\n| && + ` BusyIndicator.hide();` && |\n| && + ` sap.z2ui5.isBusy = false;` && |\n| && + ` return;` && |\n| && + ` }` && |\n| && + |\n| && + ` const { S_POPUP, S_VIEW_NEST, S_VIEW_NEST2, S_POPOVER } = sap.z2ui5.oResponse.PARAMS;` && |\n| && + ` if (S_POPUP?.CHECK_DESTROY) {` && |\n| && + ` sap.z2ui5.oController.PopupDestroy();` && |\n| && + ` }` && |\n| && + ` if (S_POPOVER?.CHECK_DESTROY) {` && |\n| && + ` sap.z2ui5.oController.PopoverDestroy();` && |\n| && + ` }` && |\n| && + ` if (S_POPUP?.XML) {` && |\n| && + ` sap.z2ui5.oController.PopupDestroy();` && |\n| && + ` await this.displayFragment(S_POPUP.XML, 'oViewPopup');` && |\n| && + ` }` && |\n| && + ` if (!sap.z2ui5.checkNestAfter) {` && |\n| && + ` if (S_VIEW_NEST?.XML) {` && |\n| && + ` sap.z2ui5.oController.NestViewDestroy();` && |\n| && + ` await this.displayNestedView(S_VIEW_NEST.XML, 'oViewNest', 'S_VIEW_NEST');` && |\n| && + ` sap.z2ui5.checkNestAfter = true;` && |\n| && + ` }` && |\n| && + ` }` && |\n| && + ` if (!sap.z2ui5.checkNestAfter2) {` && |\n| && + ` if (S_VIEW_NEST2?.XML) {` && |\n| && + ` sap.z2ui5.oController.NestViewDestroy2();` && |\n| && + ` await this.displayNestedView2(S_VIEW_NEST2.XML, 'oViewNest2', 'S_VIEW_NEST2');` && |\n| && + ` sap.z2ui5.checkNestAfter2 = true;` && |\n| && + ` }` && |\n| && + ` }` && |\n| && + ` if (S_POPOVER?.XML) {` && |\n| && + ` await this.displayPopover(S_POPOVER.XML, 'oViewPopover', S_POPOVER.OPEN_BY_ID);` && |\n| && + ` }` && |\n| && + ` BusyIndicator.hide();` && |\n| && + ` sap.z2ui5.isBusy = false;` && |\n| && + ` sap.z2ui5.onAfterRendering.forEach(item => {` && |\n| && + ` if (item !== undefined) {` && |\n| && + ` item();` && |\n| && + ` }` && |\n| && + ` }` && |\n| && + ` )` && |\n| && + ` } catch (e) {` && |\n| && + ` BusyIndicator.hide(); sap.z2ui5.isBusy = false; MessageBox.error(e.toLocaleString(), {` && |\n| && + ` title: "Unexpected Error Occured - App Terminated", actions: [], onClose: () => {` && |\n| && + ` new mBusyDialog({` && |\n| && + ` text: "Please Restart the App"` && |\n| && + ` }).open();` && |\n| && + ` }` && |\n| && + ` })` && |\n| && + ` }` && |\n| && + ` },` && |\n| && + |\n| && + ` async displayFragment(xml, viewProp) {` && |\n| && + ` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && + ` const oFragment = await Fragment.load({` && |\n| && + ` definition: xml,` && |\n| && + ` controller: sap.z2ui5.oControllerPopup,` && |\n| && + ` id: "popupId"` && |\n| && + ` });` && |\n| && + ` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && + ` oFragment.setModel(oview_model);` && |\n| && + ` sap.z2ui5[viewProp] = oFragment;` && |\n| && + ` sap.z2ui5[viewProp].Fragment = Fragment;` && |\n| && + ` oFragment.open();` && |\n| && + ` },` && |\n| && + ` async displayPopover(xml, viewProp, openById) {` && |\n| && + ` // let sapUiCore = sap.ui.require('sap/ui/core/Core');` && |\n| && + ` sap.ui.require(["sap/ui/core/Element"], async function (Element) {` && |\n| && + ` const oFragment = await Fragment.load({` && |\n| && + ` definition: xml,` && |\n| && + ` controller: sap.z2ui5.oControllerPopover,` && |\n| && + ` id: "popoverId"` && |\n| && + ` });` && |\n| && + ` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && + ` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && + ` oFragment.setModel(oview_model);` && |\n| && + ` sap.z2ui5[viewProp] = oFragment;` && |\n| && + ` sap.z2ui5[viewProp].Fragment = Fragment;` && |\n| && + ` let oControl = {};` && |\n| && + ` if (sap.z2ui5.oView?.byId(openById)) {` && |\n| && + ` oControl = sap.z2ui5.oView.byId(openById);` && |\n| && + ` } else if (sap.z2ui5.oViewPopup?.Fragment.byId('popupId', openById)) {` && |\n| && + ` oControl = sap.z2ui5.oViewPopup.Fragment.byId('popupId', openById);` && |\n| && + ` } else if (sap.z2ui5.oViewNest?.byId(openById)) {` && |\n| && + ` oControl = sap.z2ui5.oViewNest.byId(openById);` && |\n| && + ` } else if (sap.z2ui5.oViewNest2?.byId(openById)) {` && |\n| && + ` oControl = sap.z2ui5.oViewNest2.byId(openById);` && |\n| && + ` } else {` && |\n| && + ` if (sapUiCore.byId(openById)) {` && |\n| && + ` // oControl = sapUiCore.byId(openById);` && |\n| && + ` oControl = Element.getElementById(openById);` && |\n| && + ` } else {` && |\n| && + ` oControl = null;` && |\n| && + ` };` && |\n| && + ` }` && |\n| && + ` oFragment.openBy(oControl);` && |\n| && + ` });` && |\n| && + ` },` && |\n| && + ` async displayNestedView(xml, viewProp, viewNestId) {` && |\n| && + ` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && + ` const oView = await XMLView.create({` && |\n| && + ` definition: xml,` && |\n| && + ` controller: sap.z2ui5.oControllerNest,` && |\n| && + ` preprocessors: { xml: { models: { template: oview_model } } }` && |\n| && + ` });` && |\n| && + ` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && + ` oView.setModel(oview_model);` && |\n| && + ` let oParent = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS[viewNestId].ID);` && |\n| && + ` if (oParent) {` && |\n| && + ` try {` && |\n| && + ` oParent[sap.z2ui5.oResponse.PARAMS[viewNestId].METHOD_DESTROY]();` && |\n| && + ` } catch { }` && |\n| && + ` oParent[sap.z2ui5.oResponse.PARAMS[viewNestId].METHOD_INSERT](oView);` && |\n| && + ` }` && |\n| && + ` sap.z2ui5[viewProp] = oView;` && |\n| && + ` },` && |\n| && + ` async displayNestedView2(xml, viewProp, viewNestId) {` && |\n| && + ` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && + ` const oView = await XMLView.create({` && |\n| && + ` definition: xml,` && |\n| && + ` controller: sap.z2ui5.oControllerNest2,` && |\n| && + ` preprocessors: { xml: { models: { template: oview_model } } }` && |\n| && + ` });` && |\n| && + ` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && + ` oView.setModel(oview_model);` && |\n| && + ` let oParent = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS[viewNestId].ID);` && |\n| && + ` if (oParent) {` && |\n| && + ` try {` && |\n| && + ` oParent[sap.z2ui5.oResponse.PARAMS[viewNestId].METHOD_DESTROY]();` && |\n| && + ` } catch { }` && |\n| && + ` oParent[sap.z2ui5.oResponse.PARAMS[viewNestId].METHOD_INSERT](oView);` && |\n| && + ` }` && |\n| && + ` sap.z2ui5[viewProp] = oView;` && |\n| && + ` },` && |\n| && + ` PopupDestroy() {` && |\n| && + ` if (!sap.z2ui5.oViewPopup) {` && |\n| && + ` return;` && |\n| && + ` }` && |\n| && + ` if (sap.z2ui5.oViewPopup.close) {` && |\n| && + ` try {` && |\n| && + ` sap.z2ui5.oViewPopup.close();` && |\n| && + ` } catch { }` && |\n| && + ` }` && |\n| && + ` sap.z2ui5.oViewPopup.destroy();` && |\n| && + ` },` && |\n| && + ` PopoverDestroy() {` && |\n| && + ` if (!sap.z2ui5.oViewPopover) {` && |\n| && + ` return;` && |\n| && + ` }` && |\n| && + ` if (sap.z2ui5.oViewPopover.close) {` && |\n| && + ` try {` && |\n| && + ` sap.z2ui5.oViewPopover.close();` && |\n| && + ` } catch { }` && |\n| && + ` }` && |\n| && + ` sap.z2ui5.oViewPopover.destroy();` && |\n| && + ` },` && |\n| && + ` NestViewDestroy() {` && |\n| && + ` if (!sap.z2ui5.oViewNest) {` && |\n| && + ` return;` && |\n| && + ` }` && |\n| && + ` sap.z2ui5.oViewNest.destroy();` && |\n| && + ` },` && |\n| && + ` NestViewDestroy2() {` && |\n| && + ` if (!sap.z2ui5.oViewNest2) {` && |\n| && + ` return;` && |\n| && + ` }` && |\n| && + ` sap.z2ui5.oViewNest2.destroy();` && |\n| && + ` },` && |\n| && + ` ViewDestroy() {` && |\n| && + ` if (!sap.z2ui5.oView) {` && |\n| && + ` return;` && |\n| && + ` }` && |\n| && + ` sap.z2ui5.oView.destroy();` && |\n| && + ` },` && |\n| && + ` eF(...args) {` && |\n| && + ` sap.z2ui5.onBeforeEventFrontend.forEach(item => {` && |\n| && + ` if (item !== undefined) {` && |\n| && + ` item(args);` && |\n| && + ` }` && |\n| && + ` }` && |\n| && + ` )` && |\n| && + ` let oCrossAppNavigator;` && |\n| && + ` switch (args[0]) {` && |\n| && + ` case 'SET_SIZE_LIMIT':` && |\n| && + ` sap.z2ui5.JSON_MODEL_LIMIT = args[1];` && |\n| && + ` break;` && |\n| && + ` case 'DOWNLOAD_B64_FILE':` && |\n| && + ` var a = document.createElement("a");` && |\n| && + ` a.href = args[1];` && |\n| && + ` a.download = args[2];` && |\n| && + ` a.click();` && |\n| && + ` break;` && |\n| && + ` case 'CROSS_APP_NAV_TO_PREV_APP':` && |\n| && + ` oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");` && |\n| && + ` oCrossAppNavigator.backToPreviousApp();` && |\n| && + ` break;` && |\n| && + ` case 'CROSS_APP_NAV_TO_EXT':` && |\n| && + ` oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");` && |\n| && + ` const hash = (oCrossAppNavigator.hrefForExternal({` && |\n| && + ` target: args[1],` && |\n| && + ` params: args[2]` && |\n| && + ` })) || "";` && |\n| && + ` if (args[3] === 'EXT') {` && |\n| && + ` let url = window.location.href.split('#')[0] + hash;` && |\n| && + ` sap.m.URLHelper.redirect(url, true);` && |\n| && + ` } else {` && |\n| && + ` oCrossAppNavigator.toExternal({` && |\n| && + ` target: {` && |\n| && + ` shellHash: hash` && |\n| && + ` }` && |\n| && + ` });` && |\n| && + ` }` && |\n| && + ` break;` && |\n| && + ` case 'LOCATION_RELOAD':` && |\n| && + ` window.location = args[1];` && |\n| && + ` break;` && |\n| && + ` case 'OPEN_NEW_TAB':` && |\n| && + ` window.open(args[1], '_blank');` && |\n| && + ` break;` && |\n| && + ` case 'POPUP_CLOSE':` && |\n| && + ` sap.z2ui5.oController.PopupDestroy();` && |\n| && + ` break;` && |\n| && + ` case 'POPOVER_CLOSE':` && |\n| && + ` sap.z2ui5.oController.PopoverDestroy();` && |\n| && + ` break;` && |\n| && + ` case 'NAV_CONTAINER_TO':` && |\n| && + ` var navCon = sap.z2ui5.oView.byId(args[1]);` && |\n| && + ` var navConTo = sap.z2ui5.oView.byId(args[2]);` && |\n| && + ` navCon.to(navConTo);` && |\n| && + ` break;` && |\n| && + ` case 'NEST_NAV_CONTAINER_TO':` && |\n| && + ` navCon = sap.z2ui5.oViewNest.byId(args[1]);` && |\n| && + ` navConTo = sap.z2ui5.oViewNest.byId(args[2]);` && |\n| && + ` navCon.to(navConTo);` && |\n| && + ` break;` && |\n| && + ` case 'NEST2_NAV_CONTAINER_TO':` && |\n| && + ` navCon = sap.z2ui5.oViewNest2.byId(args[1]);` && |\n| && + ` navConTo = sap.z2ui5.oViewNest2.byId(args[2]);` && |\n| && + ` navCon.to(navConTo);` && |\n| && + ` break;` && |\n| && + ` case 'POPUP_NAV_CONTAINER_TO':` && |\n| && + ` navCon = Fragment.byId("popupId", args[1]);` && |\n| && + ` navConTo = Fragment.byId("popupId", args[2]);` && |\n| && + ` navCon.to(navConTo);` && |\n| && + ` break;` && |\n| && + ` }` && |\n| && + ` },` && |\n| && + ` eB(...args) {` && |\n| && + ` if (!window.navigator.onLine) {` && |\n| && + ` MessageBox.alert('No internet connection! Please reconnect to the server and try again.');` && |\n| && + ` return;` && |\n| && + ` }` && |\n| && + ` if (sap.z2ui5.isBusy == true) {` && |\n| && + ` if (!args[0][2]) {` && |\n| && + ` let oBusyDialog = new mBusyDialog();` && |\n| && + ` oBusyDialog.open();` && |\n| && + ` setTimeout((oBusyDialog) => { oBusyDialog.close() }, 100, oBusyDialog);` && |\n| && + ` return;` && |\n| && + ` }` && |\n| && + ` }` && |\n| && + ` sap.z2ui5.isBusy = true;` && |\n| && + ` BusyIndicator.show();` && |\n| && + ` sap.z2ui5.oBody = {};` && |\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| && + ` (sap.z2ui5.oControllerPopup == this) {` && |\n| && + ` if (sap.z2ui5.oViewPopup) {` && |\n| && + ` sap.z2ui5.oBody.XX = sap.z2ui5.oViewPopup.getModel().getData().XX;` && |\n| && + ` }` && |\n| && + ` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| && + ` } else if (` && |\n| && + ` sap.z2ui5.oControllerPopover == this) {` && |\n| && + ` sap.z2ui5.oBody.XX = sap.z2ui5.oViewPopover.getModel().getData().XX;` && |\n| && + ` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| && + ` } else if (` && |\n| && + ` sap.z2ui5.oControllerNest == this) {` && |\n| && + ` sap.z2ui5.oBody.XX = sap.z2ui5.oViewNest.getModel().getData().XX;` && |\n| && + ` sap.z2ui5.oBody.VIEWNAME = 'NEST';` && |\n| && + ` } else if (` && |\n| && + ` sap.z2ui5.oControllerNest2 == this) {` && |\n| && + ` sap.z2ui5.oBody.XX = sap.z2ui5.oViewNest2.getModel().getData().XX;` && |\n| && + ` sap.z2ui5.oBody.VIEWNAME = 'NEST2';` && |\n| && + ` }` && |\n| && + ` sap.z2ui5.onBeforeRoundtrip.forEach(item => {` && |\n| && + ` if (item !== undefined) {` && |\n| && + ` item();` && |\n| && + ` }` && |\n| && + ` })` && |\n| && + ` if (args[0][1]) {` && |\n| && + ` sap.z2ui5.oController.ViewDestroy();` && |\n| && + ` }` && |\n| && + ` sap.z2ui5.oBody.ID = sap.z2ui5.oResponse.ID;` && |\n| && + ` sap.z2ui5.oBody.ARGUMENTS = args;` && |\n| && + ` sap.z2ui5.oBody.ARGUMENTS.forEach((item, i) => {` && |\n| && + ` if (i == 0) { return; } if (typeof item === 'object') {` && |\n| && + ` sap.z2ui5.oBody.ARGUMENTS[i] = JSON.stringify(item);` && |\n| && + ` }` && |\n| && + ` });` && |\n| && + ` sap.z2ui5.oResponseOld = sap.z2ui5.oResponse;` && |\n| && + ` sap.z2ui5.oController.Roundtrip();` && |\n| && + ` },` && |\n| && + ` responseError(response) {` && |\n| && + ` document.write(response);` && |\n| && + ` },` && |\n| && + ` updateModelIfRequired(paramKey, oView) {` && |\n| && + ` if (sap.z2ui5.oResponse.PARAMS == undefined) { return; }` && |\n| && + ` if (sap.z2ui5.oResponse.PARAMS[paramKey]?.CHECK_UPDATE_MODEL) {` && |\n| && + ` let model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && + ` model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && + ` if (oView) { oView.setModel(model); }` && |\n| && + ` }` && |\n| && + ` },` && |\n| && + ` async responseSuccess(response) {` && |\n| && + ` try {` && |\n| && + ` sap.z2ui5.oResponse = response;` && |\n| && + ` if (sap.z2ui5.oResponse.PARAMS?.S_VIEW?.CHECK_DESTROY) {` && |\n| && + ` sap.z2ui5.oController.ViewDestroy();` && |\n| && + ` };` && |\n| && + ` if (sap.z2ui5.oResponse.PARAMS?.S_FOLLOW_UP_ACTION?.CUSTOM_JS) {` && |\n| && + ` setTimeout(() => {` && |\n| && + ` let mParams = sap.z2ui5.oResponse?.PARAMS.S_FOLLOW_UP_ACTION.CUSTOM_JS.split("'");` && |\n| && + ` let mParamsEF = mParams.filter((val, index) => index % 2)` && |\n| && + ` if (mParamsEF.length) {` && |\n| && + ` sap.z2ui5.oController.eF.apply(undefined, mParamsEF);` && |\n| && + ` } else {` && |\n| && + ` Function("return " + mParams[0])();` && |\n| && + ` }` && |\n| && + ` }, 100);` && |\n| && + ` };` && |\n| && + |\n| && + ` sap.z2ui5.oController.showMessage('S_MSG_TOAST', sap.z2ui5.oResponse.PARAMS);` && |\n| && + ` sap.z2ui5.oController.showMessage('S_MSG_BOX', sap.z2ui5.oResponse.PARAMS);` && |\n| && + ` if (sap.z2ui5.oResponse.PARAMS?.S_VIEW?.XML) {` && |\n| && + ` if (sap.z2ui5.oResponse.PARAMS?.S_VIEW?.XML !== '') {` && |\n| && + ` sap.z2ui5.oController.ViewDestroy();` && |\n| && + ` await sap.z2ui5.oController.createView(sap.z2ui5.oResponse.PARAMS.S_VIEW.XML, sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && + ` return;` && |\n| && + ` }` && |\n| && + ` }` && |\n| && + ` this.updateModelIfRequired('S_VIEW', sap.z2ui5.oView);` && |\n| && + ` this.updateModelIfRequired('S_VIEW_NEST', sap.z2ui5.oViewNest);` && |\n| && + ` this.updateModelIfRequired('S_VIEW_NEST2', sap.z2ui5.oViewNest2);` && |\n| && + ` this.updateModelIfRequired('S_POPUP', sap.z2ui5.oViewPopup);` && |\n| && + ` this.updateModelIfRequired('S_POPOVER', sap.z2ui5.oViewPopover);` && |\n| && + ` sap.z2ui5.oController.onAfterRendering();` && |\n| && + ` } catch (e) {` && |\n| && + ` BusyIndicator.hide(); if (e.message.includes("openui5")) { if (e.message.includes("script load error")) { sap.z2ui5.oController.checkSDKcompatibility(e) } } else {` && |\n| && + ` MessageBox.error(e.toLocaleString());` && |\n| && + ` }` && |\n| && + ` }` && |\n| && + ` },` && |\n| && + ` async checkSDKcompatibility(err) {` && |\n| && + ` let oCurrentVersionInfo = await VersionInfo.load();` && |\n| && + ` var ui5_sdk = oCurrentVersionInfo.gav.includes('com.sap.ui5') ? true : false;` && |\n| && + ` if (!ui5_sdk) {` && |\n| && + ` if (err) {` && |\n| && + ` MessageBox.error("openui5 SDK is loaded, module: " + err._modules + " is not availabe in openui5");` && |\n| && + ` return;` && |\n| && + ` };` && |\n| && + ` };` && |\n| && + ` MessageBox.error(err.toLocaleString());` && |\n| && + ` },` && |\n| && + ` showMessage(msgType, params) {` && |\n| && + ` if (params == undefined) { return; }` && |\n| && + ` if (params[msgType]?.TEXT !== undefined) {` && |\n| && + ` if (msgType === 'S_MSG_TOAST') {` && |\n| && + ` MessageToast.show(params[msgType].TEXT, {` && |\n| && + ` duration: params[msgType].DURATION ? parseInt(params[msgType].DURATION) : 3000,` && |\n| && + ` width: params[msgType].WIDTH ? params[msgType].WIDTH : '15em',` && |\n| && + ` onClose: params[msgType].ONCLOSE ? params[msgType].ONCLOSE : null,` && |\n| && + ` autoClose: params[msgType].AUTOCLOSE ? true : false,` && |\n| && + ` animationTimingFunction: params[msgType].ANIMATIONTIMINGFUNCTION ? params[msgType].ANIMATIONTIMINGFUNCTION : 'ease',` && |\n| && + ` animationDuration: params[msgType].ANIMATIONDURATION ? parseInt(params[msgType].ANIMATIONDURATION) : 1000,` && |\n| && + ` closeonBrowserNavigation: params[msgType].CLOSEONBROWSERNAVIGATION ? true : false` && |\n| && + ` });` && |\n| && + ` if (params[msgType].CLASS) {` && |\n| && + ` let mtoast = {};` && |\n| && + ` mtoast = document.getElementsByClassName("sapMMessageToast")[0];` && |\n| && + ` if (mtoast) { mtoast.classList.add(params[msgType].CLASS); }` && |\n| && + ` };` && |\n| && + ` } else if (msgType === 'S_MSG_BOX') {` && |\n| && + ` if (params[msgType].TYPE) {` && |\n| && + ` MessageBox[params[msgType].TYPE](params[msgType].TEXT);` && |\n| && + ` } else {` && |\n| && + ` MessageBox.show(params[msgType].TEXT, {` && |\n| && + ` styleClass: params[msgType].STYLECLASS ? params[msgType].STYLECLASS : '',` && |\n| && + ` title: params[msgType].TITLE ? params[msgType].TITLE : '',` && |\n| && + ` onClose: params[msgType].ONCLOSE ? Function("sAction", "return " + params[msgType].ONCLOSE) : null,` && |\n| && + ` actions: params[msgType].ACTIONS ? params[msgType].ACTIONS : 'OK',` && |\n| && + ` emphasizedAction: params[msgType].EMPHASIZEDACTION ? params[msgType].EMPHASIZEDACTION : 'OK',` && |\n| && + ` initialFocus: params[msgType].INITIALFOCUS ? params[msgType].INITIALFOCUS : null,` && |\n| && + ` textDirection: params[msgType].TEXTDIRECTION ? params[msgType].TEXTDIRECTION : 'Inherit',` && |\n| && + ` icon: params[msgType].ICON ? params[msgType].ICON : 'NONE',` && |\n| && + ` details: params[msgType].DETAILS ? params[msgType].DETAILS : '',` && |\n| && + ` closeOnNavigation: params[msgType].CLOSEONNAVIGATION ? true : false` && |\n| && + ` }` && |\n| && + ` )` && |\n| && + ` }` && |\n| && + ` }` && |\n| && + ` }` && |\n| && + ` },` && |\n| && + ` setApp(oApp) {` && |\n| && + ` this._oApp = oApp;` && |\n| && + ` },` && |\n| && + ` async createView(xml, viewModel) {` && |\n| && + ` let oview_model = new JSONModel(viewModel);` && |\n| && + ` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && + ` sap.z2ui5.oView = await XMLView.create({` && |\n| && + ` definition: xml,` && |\n| && + ` models: oview_model,` && |\n| && + ` controller: sap.z2ui5.oController,` && |\n| && + ` id: 'mainView',` && |\n| && + ` preprocessors: { xml: { models: { template: oview_model } } }` && |\n| && + ` });` && |\n| && + ` sap.z2ui5.oView.setModel(sap.z2ui5.oDeviceModel, "device");` && |\n| && + ` if (sap.z2ui5.oParent) {` && |\n| && + ` sap.z2ui5.oParent.removeAllPages();` && |\n| && + ` sap.z2ui5.oParent.insertPage(sap.z2ui5.oView);` && |\n| && + ` } else {` && |\n| && + ` this._oApp.byId("viewContainer").insertPage(sap.z2ui5.oView);` && |\n| && + ` // this._oApp.byId("viewContainer").addItem(sap.z2ui5.oView);` && |\n| && + ` }` && |\n| && + ` },` && |\n| && + ` async readHttp() {` && |\n| && + |\n| && + ` const response = await fetch(sap.z2ui5.pathname, {` && |\n| && + ` method: 'POST',` && |\n| && + ` headers: {` && |\n| && + ` 'Content-Type': 'application/json',` && |\n| && + ` 'sap-contextid-accept': 'header',` && |\n| && + ` 'sap-contextid': sap.z2ui5.contextId` && |\n| && + ` },` && |\n| && + ` body: JSON.stringify(sap.z2ui5.oBody)` && |\n| && + ` });` && |\n| && + ` sap.z2ui5.contextId = response.headers.get("sap-contextid");` && |\n| && + ` if (!response.ok) {` && |\n| && + ` const responseText = await response.text();` && |\n| && + ` sap.z2ui5.oController.responseError(responseText);` && |\n| && + ` } else {` && |\n| && + ` const responseData = await response.json();` && |\n| && + ` sap.z2ui5.responseData = responseData;` && |\n| && + ` sap.z2ui5.oController.responseSuccess({` && |\n| && + ` ID: responseData.S_FRONT.ID,` && |\n| && + ` PARAMS: responseData.S_FRONT.PARAMS,` && |\n| && + ` OVIEWMODEL: responseData.MODEL,` && |\n| && + ` });` && |\n| && + ` }` && |\n| && + ` },` && |\n| && + ` Roundtrip() {` && |\n| && + ` sap.z2ui5.checkTimerActive = false;` && |\n| && + ` sap.z2ui5.checkNestAfter = false;` && |\n| && + ` sap.z2ui5.checkNestAfter2 = false;` && |\n| && + ` let event = (args) => { if (args != undefined) { return args[0][0]; } };` && |\n| && + ` sap.z2ui5.oBody.S_FRONT = {` && |\n| && + ` ID: sap.z2ui5?.oBody?.ID,` && |\n| && + ` COMPDATA: (sap.z2ui5.ComponentData) ? sap.z2ui5.ComponentData : {},` && |\n| && + ` XX: sap.z2ui5?.oBody?.XX,` && |\n| && + ` ORIGIN: window.location.origin,` && |\n| && + ` PATHNAME: window.location.pathname, // sap.z2ui5.pathname,` && |\n| && + ` SEARCH: (sap.z2ui5.search) ? sap.z2ui5.search : window.location.search,` && |\n| && + ` VIEW: sap.z2ui5.oBody?.VIEWNAME,` && |\n| && + ` T_STARTUP_PARAMETERS: sap.z2ui5.startupParameters,` && |\n| && + ` EVENT: event(sap.z2ui5.oBody?.ARGUMENTS),` && |\n| && + ` };` && |\n| && + ` if (sap.z2ui5.oBody?.ARGUMENTS != undefined) { if (sap.z2ui5.oBody?.ARGUMENTS.length > 0) { sap.z2ui5.oBody?.ARGUMENTS.shift(); } }` && |\n| && + ` sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG = sap.z2ui5.oBody?.ARGUMENTS;` && |\n| && + ` delete sap.z2ui5.oBody.ID;` && |\n| && + ` delete sap.z2ui5.oBody?.VIEWNAME;` && |\n| && + ` delete sap.z2ui5.oBody?.S_FRONT.XX;` && |\n| && + ` delete sap.z2ui5.oBody?.ARGUMENTS;` && |\n| && + ` if (!sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG) { delete sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG; }` && |\n| && + ` if (sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG) { if (sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG.length == 0) { delete sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG; } }` && |\n| && + ` if (sap.z2ui5.oBody.S_FRONT.T_STARTUP_PARAMETERS == undefined) { delete sap.z2ui5.oBody.S_FRONT.T_STARTUP_PARAMETERS; }` && |\n| && + ` if (sap.z2ui5.oBody.S_FRONT.SEARCH == '') { delete sap.z2ui5.oBody.S_FRONT.SEARCH; }` && |\n| && + ` if (!sap.z2ui5.oBody.XX) { delete sap.z2ui5.oBody.XX; }` && |\n| && + ` sap.z2ui5.oController.readHttp();` && |\n| && + ` },` && |\n| && + ` })` && |\n| && + ` });`. + + ENDMETHOD. + + METHOD manifest_json. + + result = `{` && + ` "_version": "1.50.0",` && + ` "sap.app": {` && + ` "id": "z2ui5",` && + ` "type": "application",` && + ` "i18n": "i18n/i18n.properties",` && + ` "applicationVersion": {` && + ` "version": "0.0.2"` && + ` },` && +* ` "title": "{{appTitle}}",` && +* ` "description": "{{appDescription}}",` && +* ` "resources": "resources.json",` && + ` "sourceTemplate": {` && + ` "id": "@sap/generator-fiori:basic",` && + ` "version": "1.10.4",` && + ` "toolsId": "45f51711-e1b8-4fc4-bc1b-9e341941c532"` && + ` },` && + ` "dataSources": {` && + ` "mainService": {` && + ` "uri": "/sap/bc/z2ui5",` && + ` "type": "http"` && + ` }` && + ` }` && + ` },` && + ` "sap.ui": {` && + ` "technology": "UI5",` && + ` "icons": {` && + ` "icon": "",` && + ` "favIcon": "",` && + ` "phone": "",` && + ` "phone@2": "",` && + ` "tablet": "",` && + ` "tablet@2": ""` && + ` },` && + ` "deviceTypes": {` && + ` "desktop": true,` && + ` "tablet": true,` && + ` "phone": true` && + ` },` && + ` "fullWidth": true` && + ` },` && + ` "sap.ui5": {` && + ` "flexEnabled": true,` && + ` "dependencies": {` && + ` "minUI5Version": "1.116.0",` && + ` "libs": {` && + ` "sap.m": {},` && + ` "sap.ui.core": {},` && + ` "sap.f": {},` && + ` "sap.ui.table": {}` && + ` }` && + ` },` && + ` "contentDensities": {` && + ` "compact": true,` && + ` "cozy": true` && + ` },` && + ` "services": {` && + ` "ShellUIService": {` && + ` "factoryName": "sap.ushell.ui5service.ShellUIService"` && + ` }` && + ` },` && + ` "models": {` && + ` "i18n": {` && + ` "type": "sap.ui.model.resource.ResourceModel",` && + ` "settings": {` && + ` "bundleName": "z2ui5.i18n.i18n"` && + ` }` && + ` }` && + ` },` && + ` "resources": {` && + ` "css": [` && + ` {` && + ` "uri": "css/style.css"` && + ` }` && + ` ]` && + ` },` && + ` "routing": {` && + ` "config": {` && + ` "routerClass": "sap.m.routing.Router",` && + ` "viewType": "XML",` && + ` "async": true,` && + ` "viewPath": "z2ui5.view",` && + ` "controlAggregation": "pages",` && + ` "controlId": "viewContainer2",` && + ` "clearControlAggregation": false` && + ` },` && + ` "routes": [` && + ` {` && + ` "name": "RouteView1",` && + ` "pattern": ":?query:",` && + ` "target": [` && + ` "TargetView2"` && + ` ]` && + ` }` && + ` ],` && + ` "targets": {` && + ` "TargetView1": {` && + ` "viewType": "XML",` && + ` "transition": "slide",` && + ` "clearControlAggregation": false,` && + ` "viewId": "View1",` && + ` "viewName": "View1"` && + ` }` && + ` }` && + ` },` && + ` "rootView": {` && + ` "viewName": "z2ui5.view.App",` && + ` "type": "XML",` && + ` "async": true,` && + ` "id": "rootView"` && + ` }` && + ` }` && + `}`. + + ENDMETHOD. + + METHOD view_app_xml. + + result = `` && + ` ` && + ``. + + ENDMETHOD. + + METHOD view_view1_xml. + + result = `` && + ``. + + ENDMETHOD. + + METHOD model_models_js. + + result = `sap.ui.define(["sap/ui/model/json/JSONModel", "sap/ui/Device"], ` && |\n| && + ` ` && |\n| && + `function(JSONModel, Device) {` && |\n| && + ` "use strict";` && |\n| && + |\n| && + ` return {` && |\n| && + ` createDeviceModel: function() {` && |\n| && + ` var oModel = new JSONModel(Device);` && |\n| && + ` oModel.setDefaultBindingMode("OneWay");` && |\n| && + ` return oModel;` && |\n| && + ` }` && |\n| && + ` };` && |\n| && + `});`. + + ENDMETHOD. + + METHOD css_style_css. + + result = ``. + + ENDMETHOD. + + METHOD i18n_i18n_properties. + + "Do not use, makes no sense + result = ``. + + ENDMETHOD. + +ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_http_get.clas.testclasses.abap b/src/01/02/z2ui5_cl_core_http_get.clas.testclasses.abap index 3bb705ee..677fce33 100644 --- a/src/01/02/z2ui5_cl_core_http_get.clas.testclasses.abap +++ b/src/01/02/z2ui5_cl_core_http_get.clas.testclasses.abap @@ -8,7 +8,6 @@ CLASS ltcl_test_http_get DEFINITION FINAL FOR TESTING PRIVATE SECTION. METHODS file_not_initial FOR TESTING RAISING cx_static_check. METHODS launchpad_compatibility FOR TESTING RAISING cx_static_check. - METHODS path_setup FOR TESTING RAISING cx_static_check. METHODS js_no_debugger FOR TESTING RAISING cx_static_check. METHODS js_no_sap_ui_get_core FOR TESTING RAISING cx_static_check. METHODS js_no_window FOR TESTING RAISING cx_static_check. @@ -45,20 +44,6 @@ CLASS ltcl_test_http_get IMPLEMENTATION. ENDMETHOD. - METHOD path_setup. - - DATA(lo_get) = NEW z2ui5_cl_core_http_get( ). - DATA(lv_index_html) = to_upper( lo_get->main( ) ). - IF lv_index_html CS `SAP.Z2UI5.PATHNAME || '/SAP/TEST';`. - cl_abap_unit_assert=>fail( 'path static' ). - ENDIF. - - IF lv_index_html NS `SAP.Z2UI5.PATHNAME || WINDOW.LOCATION.PATHNAME;`. - cl_abap_unit_assert=>fail( 'path static' ). - ENDIF. - - ENDMETHOD. - METHOD js_no_debugger. DATA(lo_get) = NEW z2ui5_cl_core_http_get( ). diff --git a/src/01/02/z2ui5_if_core_types.intf.abap b/src/01/02/z2ui5_if_core_types.intf.abap index d9aa70bb..7fda9b1e 100644 --- a/src/01/02/z2ui5_if_core_types.intf.abap +++ b/src/01/02/z2ui5_if_core_types.intf.abap @@ -51,8 +51,6 @@ INTERFACE z2ui5_if_core_types xml TYPE string, check_destroy TYPE abap_bool, check_update_model TYPE abap_bool, -* update_path TYPE string_table, - s_config TYPE z2ui5_if_types=>ty_s_view_config, END OF s_view, BEGIN OF s_view_nest, xml TYPE string, @@ -61,7 +59,6 @@ INTERFACE z2ui5_if_core_types method_destroy TYPE string, check_destroy TYPE abap_bool, check_update_model TYPE abap_bool, - s_config TYPE z2ui5_if_types=>ty_s_view_config, END OF s_view_nest, BEGIN OF s_view_nest2, xml TYPE string, @@ -70,14 +67,12 @@ INTERFACE z2ui5_if_core_types method_destroy TYPE string, check_destroy TYPE abap_bool, check_update_model TYPE abap_bool, - s_config TYPE z2ui5_if_types=>ty_s_view_config, END OF s_view_nest2, BEGIN OF s_popup, xml TYPE string, id TYPE string, check_destroy TYPE abap_bool, check_update_model TYPE abap_bool, - s_config TYPE z2ui5_if_types=>ty_s_view_config, END OF s_popup, BEGIN OF s_popover, xml TYPE string, @@ -85,7 +80,6 @@ INTERFACE z2ui5_if_core_types open_by_id TYPE string, check_destroy TYPE abap_bool, check_update_model TYPE abap_bool, - s_config TYPE z2ui5_if_types=>ty_s_view_config, END OF s_popover, BEGIN OF s_msg_box, type TYPE string, diff --git a/src/01/04/z2ui5_cl_cc_debug_tool.clas.abap b/src/01/04/z2ui5_cl_cc_debug_tool.clas.abap index d75ee430..7750dd0e 100644 --- a/src/01/04/z2ui5_cl_cc_debug_tool.clas.abap +++ b/src/01/04/z2ui5_cl_cc_debug_tool.clas.abap @@ -264,7 +264,7 @@ CLASS z2ui5_cl_cc_debug_tool IMPLEMENTATION. ` }, ` && |\n| && ` });` && |\n| && ` }); ` && - ` sap.ui.require(["z2ui5/DebuggingTools","z2ui5/Controller"], (DebuggingTools) => { z2ui5.DebuggingTools = new DebuggingTools(); ` && |\n| && + ` sap.ui.require(["z2ui5/DebuggingTools"], (DebuggingTools) => { z2ui5.DebuggingTools = new DebuggingTools(); ` && |\n| && ` }); }`. ENDMETHOD. diff --git a/src/01/04/z2ui5_cl_cc_favicon.clas.abap b/src/01/04/z2ui5_cl_cc_favicon.clas.abap index 441c76db..43fdf3e1 100644 --- a/src/01/04/z2ui5_cl_cc_favicon.clas.abap +++ b/src/01/04/z2ui5_cl_cc_favicon.clas.abap @@ -20,7 +20,7 @@ CLASS z2ui5_cl_cc_favicon IMPLEMENTATION. METHOD get_js. - result = `if (!z2ui5.Favicon) { sap.ui.define("z2ui5/Favicon" , ["sap/ui/core/Control"], (Control)=>{` && |\n| && + result = `if (!z2ui5.Favicon) { sap.ui.define("z2ui5/Favicon" , [ "sap/ui/core/Control"], (Control)=>{` && |\n| && ` "use strict";` && |\n| && ` return Control.extend("z2ui5.Favicon", {` && |\n| && ` metadata: {` && |\n| && diff --git a/src/01/04/z2ui5_cl_cc_multiinput.clas.abap b/src/01/04/z2ui5_cl_cc_multiinput.clas.abap index d778327f..6c6fead6 100644 --- a/src/01/04/z2ui5_cl_cc_multiinput.clas.abap +++ b/src/01/04/z2ui5_cl_cc_multiinput.clas.abap @@ -28,6 +28,7 @@ CLASS z2ui5_cl_cc_multiinput IMPLEMENTATION. ` metadata: {` && |\n| && ` properties: {` && |\n| && ` MultiInputId: { type: "String" },` && |\n| && + ` MultiInputName: { type: "String" },` && |\n| && ` addedTokens: { type: "Array" },` && |\n| && ` checkInit: { type: "Boolean", defaultValue : false },` && |\n| && ` removedTokens: { type: "Array" }` && |\n| && @@ -68,7 +69,11 @@ CLASS z2ui5_cl_cc_multiinput IMPLEMENTATION. ` },` && |\n| && ` setControl(){ ` && |\n| && ` let table = sap.z2ui5.oView.byId( this.getProperty("MultiInputId") );` && |\n| && - ` if (!table) { table = sap.ui.getCore().byId( this.getProperty("MultiInputId") ); } ` && |\n| && + ` if (!table) {` && |\n| && + ` try{ table = sap.ui.getCore( ).byId( ` && |\n| && + ` document.getElementsByName(this.getProperty("MultiInputName"))[0].id.replace('-inner', '')` && |\n| && + ` );` && |\n| && + `}catch (e){ return; } } ` && |\n| && ` if ( !table ){ return; } ` && |\n| && ` if ( this.getProperty("checkInit") == true ){ return; } ` && |\n| && ` this.setProperty( "checkInit" , true );` && |\n| && diff --git a/src/01/04/z2ui5_cl_cc_util.clas.abap b/src/01/04/z2ui5_cl_cc_util.clas.abap index 55631ea0..95b9f4c6 100644 --- a/src/01/04/z2ui5_cl_cc_util.clas.abap +++ b/src/01/04/z2ui5_cl_cc_util.clas.abap @@ -19,7 +19,7 @@ CLASS z2ui5_cl_cc_util IMPLEMENTATION. METHOD get_js. - result = `if (!z2ui5.Util) { sap.ui.define("z2ui5/Util" , ["sap/ui/core/Control"], (Control)=>{` && |\n| && + result = `if (!z2ui5.Util) { sap.ui.define("z2ui5/Util" , [], ()=>{` && |\n| && ` "use strict";` && |\n| && ` return {` && |\n| && ` DateCreateObject: (s) => new Date(s),` && |\n| && @@ -29,7 +29,7 @@ CLASS z2ui5_cl_cc_util IMPLEMENTATION. ` parseInt(d.slice(4, 6)) - 1, d.slice(6, 8), t.slice(0, 2), t.slice(2, 4), t.slice(4, 6)),` && |\n| && ` };` && |\n| && ` });` && - ` sap.ui.require(["z2ui5/Util","z2ui5/Controller"], (Util) => { z2ui5.Util = Util; ` && |\n| && + ` sap.ui.require(["z2ui5/Util"], (Util) => { z2ui5.Util = Util; ` && |\n| && ` }); }`. ENDMETHOD. diff --git a/src/02/z2ui5_cl_http_handler.clas.abap b/src/02/z2ui5_cl_http_handler.clas.abap index 4e975985..25ab8b2b 100644 --- a/src/02/z2ui5_cl_http_handler.clas.abap +++ b/src/02/z2ui5_cl_http_handler.clas.abap @@ -81,7 +81,18 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION. attributes = attributes ). ENDIF. - so_sticky_handler = lo_post. + TRY. + IF lo_post IS BOUND. + DATA(li_app) = CAST z2ui5_if_app( lo_post->mo_action->mo_app->mo_app ). + IF li_app->check_sticky = abap_true. + so_sticky_handler = lo_post. + ELSE. + CLEAR so_sticky_handler. + ENDIF. + + ENDIF. + CATCH cx_root. + ENDTRY. ENDMETHOD. diff --git a/src/02/z2ui5_cl_xml_view.clas.abap b/src/02/z2ui5_cl_xml_view.clas.abap index 59249def..07b6897a 100644 --- a/src/02/z2ui5_cl_xml_view.clas.abap +++ b/src/02/z2ui5_cl_xml_view.clas.abap @@ -538,6 +538,7 @@ CLASS z2ui5_cl_xml_view DEFINITION METHODS multi_input IMPORTING showclearicon TYPE clike OPTIONAL showvaluehelp TYPE clike OPTIONAL + name TYPE clike OPTIONAL suggestionitems TYPE clike OPTIONAL tokenupdate TYPE clike OPTIONAL !width TYPE clike OPTIONAL @@ -6965,6 +6966,7 @@ CLASS z2ui5_cl_xml_view IMPLEMENTATION. result = _generic( name = `MultiInput` t_prop = VALUE #( ( n = `tokens` v = tokens ) ( n = `showClearIcon` v = z2ui5_cl_util=>boolean_abap_2_json( showclearicon ) ) + ( n = `name` v = name ) ( n = `showValueHelp` v = z2ui5_cl_util=>boolean_abap_2_json( showvaluehelp ) ) ( n = `enabled` v = z2ui5_cl_util=>boolean_abap_2_json( enabled ) ) ( n = `suggestionItems` v = suggestionitems ) diff --git a/src/02/z2ui5_cl_xml_view_cc.clas.abap b/src/02/z2ui5_cl_xml_view_cc.clas.abap index 677949d1..b0d05a55 100644 --- a/src/02/z2ui5_cl_xml_view_cc.clas.abap +++ b/src/02/z2ui5_cl_xml_view_cc.clas.abap @@ -7,32 +7,13 @@ CLASS z2ui5_cl_xml_view_cc DEFINITION METHODS multiinput_ext IMPORTING - !multiinputid TYPE clike OPTIONAL - !change TYPE clike OPTIONAL - !addedtokens TYPE clike OPTIONAL - !removedtokens TYPE clike OPTIONAL + !multiinputid TYPE clike OPTIONAL + !multiinputname TYPE clike OPTIONAL + !change TYPE clike OPTIONAL + !addedtokens TYPE clike OPTIONAL + !removedtokens TYPE clike OPTIONAL RETURNING - VALUE(result) TYPE REF TO z2ui5_cl_xml_view . - - METHODS multiinput - IMPORTING - !showclearicon TYPE clike OPTIONAL - !showvaluehelp TYPE clike OPTIONAL - !suggestionitems TYPE clike OPTIONAL - !tokenupdate TYPE clike OPTIONAL - !width TYPE clike OPTIONAL - !id TYPE clike OPTIONAL - !value TYPE clike OPTIONAL - !tokens TYPE clike OPTIONAL - !submit TYPE clike OPTIONAL - !valuehelprequest TYPE clike OPTIONAL - !enabled TYPE clike OPTIONAL - !class TYPE clike OPTIONAL - !change TYPE clike OPTIONAL - !addedtokens TYPE clike OPTIONAL - !removedtokens TYPE clike OPTIONAL - RETURNING - VALUE(result) TYPE REF TO z2ui5_cl_xml_view . + VALUE(result) TYPE REF TO z2ui5_cl_xml_view . METHODS uitableext IMPORTING @@ -452,35 +433,14 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION. ENDMETHOD. - METHOD multiinput. - - result = mo_view. - mo_view->_generic( name = `MultiInput` - ns = `z2ui5` - t_prop = VALUE #( ( n = `tokens` v = tokens ) - ( n = `showClearIcon` v = z2ui5_cl_util=>boolean_abap_2_json( showclearicon ) ) - ( n = `showValueHelp` v = z2ui5_cl_util=>boolean_abap_2_json( showvaluehelp ) ) - ( n = `enabled` v = z2ui5_cl_util=>boolean_abap_2_json( enabled ) ) - ( n = `suggestionItems` v = suggestionitems ) - ( n = `tokenUpdate` v = tokenupdate ) - ( n = `submit` v = submit ) - ( n = `width` v = width ) - ( n = `value` v = value ) - ( n = `id` v = id ) - ( n = `change` v = change ) - ( n = `valueHelpRequest` v = valuehelprequest ) - ( n = `addedTokens` v = addedtokens ) - ( n = `removedTokens` v = removedtokens ) - ( n = `class` v = class ) ) ). - ENDMETHOD. - - METHOD multiinput_ext. result = mo_view. mo_view->_generic( name = `MultiInputExt` ns = `z2ui5` - t_prop = VALUE #( ( n = `MultiInputId` v = multiinputid ) + t_prop = VALUE #( + ( n = `MultiInputId` v = multiinputid ) + ( n = `MultiInputName` v = multiinputname ) ( n = `change` v = change ) ( n = `addedTokens` v = addedtokens ) ( n = `removedTokens` v = removedtokens ) ) ). diff --git a/src/02/z2ui5_if_app.intf.abap b/src/02/z2ui5_if_app.intf.abap index 8ba7d195..ecfa8f66 100644 --- a/src/02/z2ui5_if_app.intf.abap +++ b/src/02/z2ui5_if_app.intf.abap @@ -1,7 +1,7 @@ INTERFACE z2ui5_if_app PUBLIC. INTERFACES if_serializable_object. - CONSTANTS version TYPE string VALUE '1.134.0'. + CONSTANTS version TYPE string VALUE '1.135.0'. CONSTANTS origin TYPE string VALUE 'https://github.com/abap2UI5/abap2UI5'. CONSTANTS author TYPE string VALUE 'https://github.com/oblomov-dev'. CONSTANTS license TYPE string VALUE 'MIT'. diff --git a/src/02/z2ui5_if_client.intf.abap b/src/02/z2ui5_if_client.intf.abap index 419ae99b..32205b06 100644 --- a/src/02/z2ui5_if_client.intf.abap +++ b/src/02/z2ui5_if_client.intf.abap @@ -14,6 +14,7 @@ INTERFACE z2ui5_if_client cross_app_nav_to_prev_app TYPE string VALUE `CROSS_APP_NAV_TO_PREV_APP`, popup_nav_container_to TYPE string VALUE `POPUP_NAV_CONTAINER_TO`, download_b64_file TYPE string VALUE `DOWNLOAD_B64_FILE`, + set_size_limit TYPE string VALUE `SET_SIZE_LIMIT`, END OF cs_event. CONSTANTS: @@ -27,8 +28,7 @@ INTERFACE z2ui5_if_client METHODS view_display IMPORTING - val TYPE clike - s_config TYPE z2ui5_if_types=>ty_s_view_config OPTIONAL. + val TYPE clike. METHODS view_model_update. @@ -41,8 +41,7 @@ INTERFACE z2ui5_if_client val TYPE clike id TYPE clike method_insert TYPE clike - method_destroy TYPE clike OPTIONAL - s_config TYPE z2ui5_if_types=>ty_s_view_config OPTIONAL. + method_destroy TYPE clike OPTIONAL. METHODS nest_view_destroy. METHODS nest_view_model_update. @@ -52,16 +51,14 @@ INTERFACE z2ui5_if_client val TYPE clike id TYPE clike method_insert TYPE clike - method_destroy TYPE clike OPTIONAL - s_config TYPE z2ui5_if_types=>ty_s_view_config OPTIONAL. + method_destroy TYPE clike OPTIONAL. METHODS nest2_view_destroy. METHODS nest2_view_model_update. METHODS popup_display IMPORTING - val TYPE clike - s_config TYPE z2ui5_if_types=>ty_s_view_config OPTIONAL. + val TYPE clike. METHODS popup_model_update. @@ -71,9 +68,8 @@ INTERFACE z2ui5_if_client METHODS popover_display IMPORTING - xml TYPE clike - by_id TYPE clike - s_config TYPE z2ui5_if_types=>ty_s_view_config OPTIONAL. + xml TYPE clike + by_id TYPE clike. METHODS popover_destroy. @@ -81,6 +77,12 @@ INTERFACE z2ui5_if_client RETURNING VALUE(result) TYPE z2ui5_if_types=>ty_s_get. + METHODS get_event_args + IMPORTING + v TYPE i DEFAULT 1 + RETURNING + VALUE(result) TYPE string. + METHODS get_app IMPORTING id TYPE clike OPTIONAL diff --git a/src/02/z2ui5_if_types.intf.abap b/src/02/z2ui5_if_types.intf.abap index 1989bd30..fe7c6d9b 100644 --- a/src/02/z2ui5_if_types.intf.abap +++ b/src/02/z2ui5_if_types.intf.abap @@ -40,11 +40,6 @@ INTERFACE z2ui5_if_types t_startup_params TYPE ty_t_name_value, END OF ty_s_config. - TYPES: - BEGIN OF ty_s_view_config, - set_size_limit TYPE string, - END OF ty_s_view_config. - TYPES: BEGIN OF ty_s_get, event TYPE string,