mirror of
https://github.com/abap2UI5/abap2UI5.git
synced 2025-04-30 05:20:22 +08:00
Cleanup index.html (#714)
* cleanup-index.html * update importing params * update
This commit is contained in:
parent
06a48313c8
commit
eaf9e993c2
|
@ -4,110 +4,135 @@ CLASS z2ui5_cl_util_func DEFINITION
|
|||
|
||||
PUBLIC SECTION.
|
||||
|
||||
CLASS-METHODS js_load_ext_lib
|
||||
RETURNING
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS app_get_url_source_code
|
||||
IMPORTING
|
||||
!client TYPE REF TO z2ui5_if_client
|
||||
RETURNING
|
||||
VALUE(result) TYPE string .
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS app_get_url
|
||||
IMPORTING
|
||||
!client TYPE REF TO z2ui5_if_client
|
||||
VALUE(classname) TYPE string OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE string .
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS url_param_get
|
||||
IMPORTING
|
||||
!val TYPE string
|
||||
!url TYPE string
|
||||
RETURNING
|
||||
VALUE(result) TYPE string .
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS url_param_create_url
|
||||
IMPORTING
|
||||
!t_params TYPE z2ui5_if_client=>ty_t_name_value
|
||||
RETURNING
|
||||
VALUE(result) TYPE string .
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS url_param_set
|
||||
IMPORTING
|
||||
!url TYPE string
|
||||
!name TYPE string
|
||||
!value TYPE string
|
||||
RETURNING
|
||||
VALUE(result) TYPE string .
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS rtti_get_classname_by_ref
|
||||
IMPORTING
|
||||
!in TYPE REF TO object
|
||||
RETURNING
|
||||
VALUE(result) TYPE string .
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS x_check_raise
|
||||
IMPORTING
|
||||
!v TYPE clike DEFAULT `CX_SY_SUBRC`
|
||||
!when TYPE abap_bool .
|
||||
!when TYPE abap_bool.
|
||||
|
||||
CLASS-METHODS x_raise
|
||||
IMPORTING
|
||||
!v TYPE clike DEFAULT `CX_SY_SUBRC`
|
||||
PREFERRED PARAMETER v .
|
||||
PREFERRED PARAMETER v.
|
||||
|
||||
CLASS-METHODS func_get_uuid_32
|
||||
RETURNING
|
||||
VALUE(result) TYPE string .
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS func_get_uuid_22
|
||||
RETURNING
|
||||
VALUE(result) TYPE string .
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS func_get_user_tech
|
||||
RETURNING
|
||||
VALUE(result) TYPE string .
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS trans_json_any_2
|
||||
IMPORTING
|
||||
!any TYPE any
|
||||
!pretty_name TYPE clike DEFAULT /ui2/cl_json=>pretty_mode-none
|
||||
RETURNING
|
||||
VALUE(result) TYPE string .
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS trans_xml_2_any
|
||||
IMPORTING
|
||||
!xml TYPE clike
|
||||
EXPORTING
|
||||
!any TYPE any .
|
||||
!any TYPE any.
|
||||
|
||||
CLASS-METHODS trans_xml_any_2
|
||||
IMPORTING
|
||||
!any TYPE any
|
||||
RETURNING
|
||||
VALUE(result) TYPE string
|
||||
RAISING
|
||||
cx_xslt_serialization_error .
|
||||
cx_xslt_serialization_error.
|
||||
|
||||
CLASS-METHODS boolean_check
|
||||
IMPORTING
|
||||
!val TYPE any
|
||||
RETURNING
|
||||
VALUE(result) TYPE abap_bool .
|
||||
VALUE(result) TYPE abap_bool.
|
||||
|
||||
CLASS-METHODS boolean_abap_2_json
|
||||
IMPORTING
|
||||
!val TYPE any
|
||||
RETURNING
|
||||
VALUE(result) TYPE string .
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS c_replace_assign_struc
|
||||
IMPORTING
|
||||
!iv_attri TYPE clike
|
||||
RETURNING
|
||||
VALUE(rv_attri) TYPE string .
|
||||
VALUE(rv_attri) TYPE string.
|
||||
|
||||
CLASS-METHODS trans_json_2_any
|
||||
IMPORTING
|
||||
!val TYPE any
|
||||
CHANGING
|
||||
!data TYPE any .
|
||||
!data TYPE any.
|
||||
|
||||
CLASS-METHODS trans_ref_tab_2_tab
|
||||
IMPORTING
|
||||
!ir_tab_from TYPE REF TO data
|
||||
EXPORTING
|
||||
!t_result TYPE STANDARD TABLE .
|
||||
!t_result TYPE STANDARD TABLE.
|
||||
|
||||
CLASS-METHODS c_trim_upper
|
||||
IMPORTING
|
||||
!val TYPE clike
|
||||
RETURNING
|
||||
VALUE(result) TYPE string .
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS rtti_xml_get_by_data
|
||||
IMPORTING
|
||||
!data TYPE any
|
||||
RETURNING
|
||||
VALUE(result) TYPE string .
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS rtti_xml_set_to_data
|
||||
IMPORTING
|
||||
!rtti_data TYPE clike
|
||||
|
@ -332,6 +357,49 @@ CLASS z2ui5_cl_util_func IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD js_load_ext_lib.
|
||||
|
||||
result = ` async loadScriptExt(url) {` && |\n| &&
|
||||
` this.BusyDialog = new sap.m.BusyDialog({ title: "External Library", text: "... now loading the data from a far away server" });` && |\n| &&
|
||||
` this.BusyDialog.open();` && |\n| &&
|
||||
|\n| &&
|
||||
` const loadScript = (FILE_URL, async = true, type = "text/javascript") => {` && |\n| &&
|
||||
` return new Promise((resolve, reject) => {` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` const scriptEle = document.createElement("script");` && |\n| &&
|
||||
` scriptEle.type = type;` && |\n| &&
|
||||
` scriptEle.async = async;` && |\n| &&
|
||||
` scriptEle.src = FILE_URL;` && |\n| &&
|
||||
` scriptEle.addEventListener("load", (ev) => {` && |\n| &&
|
||||
` resolve({ status: true });` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` scriptEle.addEventListener("error", (ev) => {` && |\n| &&
|
||||
` reject({` && |\n| &&
|
||||
` status: false,` && |\n| &&
|
||||
` message: ``Failed to load the script ${FILE_URL}``` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` document.body.appendChild(scriptEle);` && |\n| &&
|
||||
` } catch (error) {` && |\n| &&
|
||||
` reject(error);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
|\n| &&
|
||||
` await loadScript(url)` && |\n| &&
|
||||
` .then(data => {` && |\n| &&
|
||||
` this.result = 'A';` && |\n| &&
|
||||
` }).catch(err => {` && |\n| &&
|
||||
` this.result = 'E';` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` this.BusyDialog.close();` && |\n| &&
|
||||
` return this.result;` && |\n| &&
|
||||
|\n| &&
|
||||
` },`.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD rtti_check_type_kind_dref.
|
||||
|
||||
DATA(lv_type_kind) = cl_abap_datadescr=>get_data_type_kind( val ).
|
||||
|
|
|
@ -16,13 +16,15 @@ CLASS z2ui5_cl_fw_http_handler DEFINITION
|
|||
content_security_policy TYPE clike OPTIONAL
|
||||
check_logging TYPE abap_bool OPTIONAL
|
||||
custom_js TYPE string OPTIONAL
|
||||
custom_js_oneventfrontend TYPE string OPTIONAL
|
||||
* custom_js_oneventfrontend TYPE string OPTIONAL
|
||||
json_model_limit TYPE string DEFAULT '100'
|
||||
PREFERRED PARAMETER t_config
|
||||
RETURNING
|
||||
VALUE(r_result) TYPE string.
|
||||
|
||||
PROTECTED SECTION.
|
||||
CLASS-METHODS get_js
|
||||
returning value(result) type string.
|
||||
PRIVATE SECTION.
|
||||
|
||||
|
||||
|
@ -81,458 +83,7 @@ CLASS z2ui5_cl_fw_http_handler IMPLEMENTATION.
|
|||
`<abc/>` && |\n|.
|
||||
|
||||
r_result = r_result && `<script>` && |\n| &&
|
||||
` sap.ui.core.BusyIndicator.show();` && |\n| &&
|
||||
` sap.ui.getCore().attachInit(function() {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.ui.controller("z2ui5_controller", {` && |\n| &&
|
||||
` onAfterRendering: function() {` && |\n| &&
|
||||
|\n| &&
|
||||
` if ( sap.z2ui5.oResponse.PARAMS == undefined ){ return; }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_POPUP.CHECK_DESTROY == true) {` && |\n| &&
|
||||
` sap.z2ui5.oController.PopupDestroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_POPUP.XML) {` && |\n| &&
|
||||
` sap.z2ui5.oController.PopupDestroy();` && |\n| &&
|
||||
` sap.ui.core.Fragment.load({` && |\n| &&
|
||||
` definition: sap.z2ui5.oResponse.PARAMS.S_POPUP.XML,` && |\n| &&
|
||||
` controller: sap.z2ui5.oController,` && |\n| &&
|
||||
` }).then(oFragment=>{` && |\n| &&
|
||||
` var oview_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` oFragment.setModel(oview_model)` && |\n| &&
|
||||
` sap.z2ui5.oView.addDependent(oFragment);` && |\n| &&
|
||||
` oFragment.open();` && |\n| &&
|
||||
` sap.z2ui5.oViewPopup = oFragment;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` );` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.checkNestAfter == false) {` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.XML !== '') {` && |\n| &&
|
||||
` sap.z2ui5.oController.NestViewDestroy();` && |\n| &&
|
||||
` new sap.ui.core.mvc.XMLView.create({` && |\n| &&
|
||||
` definition: sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.XML,` && |\n| &&
|
||||
` controller: sap.z2ui5.oControllerNest,` && |\n| &&
|
||||
` }).then(oView=>{` && |\n| &&
|
||||
` var oview_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` oView.setModel(oview_model);` && |\n| &&
|
||||
` var oParent = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.ID);` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` oParent[sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.METHOD_DESTROY]();` && |\n| &&
|
||||
` } catch {}` && |\n| &&
|
||||
` oParent[sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.METHOD_INSERT](oView);` && |\n| &&
|
||||
` sap.z2ui5.checkNestAfter = true;` && |\n| &&
|
||||
` sap.z2ui5.oViewNest = oView;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` , );` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.checkNestAfter2 == false) {` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.XML !== '') {` && |\n| &&
|
||||
` sap.z2ui5.oController.NestViewDestroy2();` && |\n| &&
|
||||
` new sap.ui.core.mvc.XMLView.create({` && |\n| &&
|
||||
` definition: sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.XML,` && |\n| &&
|
||||
` controller: sap.z2ui5.oControllerNest2,` && |\n| &&
|
||||
` }).then(oView=>{` && |\n| &&
|
||||
` var oview_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` oView.setModel(oview_model);` && |\n| &&
|
||||
` var oParent = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.ID);` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` oParent[sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.METHOD_DESTROY]();` && |\n| &&
|
||||
` } catch {}` && |\n| &&
|
||||
` oParent[sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.METHOD_INSERT](oView);` && |\n| &&
|
||||
` sap.z2ui5.checkNestAfter2 = true;` && |\n| &&
|
||||
` sap.z2ui5.oViewNest2 = oView;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` , );` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_POPOVER.CHECK_DESTROY == true) {` && |\n| &&
|
||||
` sap.z2ui5.oController.PopoverDestroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_POPOVER.XML) {` && |\n| &&
|
||||
` sap.z2ui5.oController.PopoverDestroy();` && |\n| &&
|
||||
` sap.ui.core.Fragment.load({` && |\n| &&
|
||||
` definition: sap.z2ui5.oResponse.PARAMS.S_POPOVER.XML,` && |\n| &&
|
||||
` controller: sap.z2ui5.oController,` && |\n| &&
|
||||
` }).then(oFragment=>{` && |\n| &&
|
||||
` var oview_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` oFragment.setModel(oview_model)` && |\n| &&
|
||||
` sap.z2ui5.oView.addDependent(oFragment);` && |\n| &&
|
||||
` var oControl = sap.ui.getCore().byId(sap.z2ui5.oResponse.PARAMS.S_POPOVER.OPEN_BY_ID);` && |\n| &&
|
||||
` if (oControl === undefined) {` && |\n| &&
|
||||
` oControl = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS.S_POPOVER.OPEN_BY_ID);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (oControl === undefined) {` && |\n| &&
|
||||
` oControl = sap.z2ui5.oViewNest.byId(sap.z2ui5.oResponse.PARAMS.S_POPOVER.OPEN_BY_ID);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (oControl === undefined) {` && |\n| &&
|
||||
` oControl = sap.z2ui5.oViewNest2.byId(sap.z2ui5.oResponse.PARAMS.S_POPOVER.OPEN_BY_ID);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` oFragment.openBy(oControl);` && |\n| &&
|
||||
` sap.z2ui5.oViewPopover = oFragment;` && |\n| &&
|
||||
` } ); }` && |\n| &&
|
||||
` sap.ui.core.BusyIndicator.hide();` && |\n| &&
|
||||
` if (sap.z2ui5.isBusy) {` && |\n| &&
|
||||
` sap.z2ui5.isBusy = false;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.b) {` && |\n| &&
|
||||
` sap.z2ui5.b.close();` && |\n| &&
|
||||
` }` && |\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| &&
|
||||
` ,` && |\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| &&
|
||||
` ,` && |\n| &&
|
||||
` NestViewDestroy: ()=>{` && |\n| &&
|
||||
` if (!sap.z2ui5.oViewNest) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.oViewNest.destroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ,` && |\n| &&
|
||||
` NestViewDestroy2: ()=>{` && |\n| &&
|
||||
` if (!sap.z2ui5.oViewNest2) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.oViewNest2.destroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ,` && |\n| &&
|
||||
` ViewDestroy: ()=>{` && |\n| &&
|
||||
` if (!sap.z2ui5.oView) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.oView.destroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ,` && |\n| &&
|
||||
` onEventFrontend: (...args)=>{` && |\n| && custom_js_oneventfrontend &&
|
||||
` switch (args[0].EVENT) {` && |\n| &&
|
||||
` case 'CROSS_APP_NAV_TO_PREV_APP':` && |\n| &&
|
||||
` var oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");` && |\n| &&
|
||||
` oCrossAppNavigator.backToPreviousApp();` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'CROSS_APP_NAV_TO_EXT':` && |\n| &&
|
||||
` var 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| &&
|
||||
` var 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| &&
|
||||
` var navCon = sap.z2ui5.oViewNest.byId(args[1]);` && |\n| &&
|
||||
` var navConTo = sap.z2ui5.oViewNest.byId(args[2]);` && |\n| &&
|
||||
` navCon.to(navConTo);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST2_NAV_CONTAINER_TO':` && |\n| &&
|
||||
` var navCon = sap.z2ui5.oViewNest2.byId(args[1]);` && |\n| &&
|
||||
` var navConTo = sap.z2ui5.oViewNest.byId(args[2]);` && |\n| &&
|
||||
` navCon.to(navConTo);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ,` && |\n| &&
|
||||
|\n| &&
|
||||
` onEvent: function(...args) {` && |\n| &&
|
||||
` if (sap.z2ui5.isBusy) {` && |\n| &&
|
||||
` if (sap.z2ui5.isBusy == true) {` && |\n| &&
|
||||
` sap.z2ui5.b = new sap.m.BusyDialog();` && |\n| &&
|
||||
` sap.z2ui5.b.open();` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.isBusy = true;` && |\n| &&
|
||||
` if (!window.navigator.onLine) {` && |\n| &&
|
||||
` sap.m.MessageBox.alert('No internet connection! Please reconnect to the server and try again.');` && |\n| &&
|
||||
` sap.z2ui5.isBusy = false;` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.ui.core.BusyIndicator.show();` && |\n| &&
|
||||
` sap.z2ui5.oBody = {};` && |\n| &&
|
||||
` let isUpdated = false;` && |\n| &&
|
||||
` if (sap.z2ui5.oViewPopup) {` && |\n| &&
|
||||
` if (!sap.z2ui5.oViewPopup.isOpen || sap.z2ui5.oViewPopup.isOpen() == true) {` && |\n| &&
|
||||
` sap.z2ui5.oBody.EDIT = sap.z2ui5.oViewPopup.getModel().getData().EDIT;` && |\n| &&
|
||||
` isUpdated = true;` && |\n| &&
|
||||
` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (isUpdated == false) {` && |\n| &&
|
||||
` if (sap.z2ui5.oViewPopover) {` && |\n| &&
|
||||
` if (sap.z2ui5.oViewPopover.isOpen) {` && |\n| &&
|
||||
` if (sap.z2ui5.oViewPopover.isOpen() == true) {` && |\n| &&
|
||||
` sap.z2ui5.oBody.EDIT = sap.z2ui5.oViewPopover.getModel().getData().EDIT;` && |\n| &&
|
||||
` isUpdated = true;` && |\n| &&
|
||||
` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.oViewPopover.destroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (isUpdated == false) {` && |\n| &&
|
||||
` if (sap.z2ui5.oViewNest == this.getView()) {` && |\n| &&
|
||||
` sap.z2ui5.oBody.EDIT = sap.z2ui5.oViewNest.getModel().getData().EDIT;` && |\n| &&
|
||||
` sap.z2ui5.oBody.VIEWNAME = 'NEST';` && |\n| &&
|
||||
` isUpdated = true;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (isUpdated == false) {` && |\n| &&
|
||||
` sap.z2ui5.oBody.EDIT = sap.z2ui5.oView.getModel().getData().EDIT;` && |\n| &&
|
||||
` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.z2ui5.onBeforeRoundtrip.forEach(item=>{` && |\n| &&
|
||||
` if (item !== undefined) {` && |\n| &&
|
||||
` item();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` )` && |\n| &&
|
||||
` if (args[0].CHECK_VIEW_DESTROY) {` && |\n| &&
|
||||
` sap.z2ui5.oController.ViewDestroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.oBody.ID = sap.z2ui5.oResponse.ID;` && |\n| &&
|
||||
` sap.z2ui5.oBody.ARGUMENTS = args;` && |\n| &&
|
||||
|\n| &&
|
||||
` if (sap.z2ui5.checkLogActive) {` && |\n| &&
|
||||
` console.log('Request Object:');` && |\n| &&
|
||||
` console.log(sap.z2ui5.oBody);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.oResponseOld = sap.z2ui5.oResponse;` && |\n| &&
|
||||
` sap.z2ui5.oResponse = {};` && |\n| &&
|
||||
` sap.z2ui5.oController.Roundtrip();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` responseError: response=>{` && |\n| &&
|
||||
` document.write(response);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ,` && |\n| &&
|
||||
` responseSuccess: response=>{` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.z2ui5.oResponse = JSON.parse(response);` && |\n| &&
|
||||
|\n| &&
|
||||
` if (sap.z2ui5.checkLogActive) {` && |\n| &&
|
||||
` console.log('Response Object:');` && |\n| &&
|
||||
` console.log(JSON.parse(JSON.stringify(sap.z2ui5.oResponse)));` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW.XML !== '') {` && |\n| &&
|
||||
` console.log('UI5-XML-View:');` && |\n| &&
|
||||
` console.log(sap.z2ui5.oResponse.PARAMS.S_VIEW.XML);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_POPUP.XML !== '') {` && |\n| &&
|
||||
` console.log('UI5-XML-Popup:');` && |\n| &&
|
||||
` console.log(sap.z2ui5.oResponse.PARAMS.S_POPUP.XML);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_POPOVER.XML !== '') {` && |\n| &&
|
||||
` console.log('UI5-XML-Popover:');` && |\n| &&
|
||||
` console.log(sap.z2ui5.oResponse.PARAMS.S_POPOVER.XML);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.XML !== '') {` && |\n| &&
|
||||
` console.log('UI5-XML-Nest:');` && |\n| &&
|
||||
` console.log(sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.XML);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.XML !== '') {` && |\n| &&
|
||||
` console.log('UI5-XML-Nest2:');` && |\n| &&
|
||||
` console.log(sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.XML);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW.CHECK_DESTROY == true) {` && |\n| &&
|
||||
` sap.z2ui5.oController.ViewDestroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW.XML !== '') {` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.z2ui5.oController.ViewDestroy();` && |\n| &&
|
||||
|\n| &&
|
||||
` new sap.ui.core.mvc.XMLView.create({` && |\n| &&
|
||||
` definition: sap.z2ui5.oResponse.PARAMS.S_VIEW.XML,` && |\n| &&
|
||||
` controller: sap.z2ui5.oController,` && |\n| &&
|
||||
` }).then(oView=>{` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` var oview_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` oView.setModel(oview_model);` && |\n| &&
|
||||
` } catch (e) {` && |\n| &&
|
||||
` oView.setModel(oview_model);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` } catch (e) {` && |\n| &&
|
||||
` sap.m.MessageBox.error('Error while creating Main View - ' + e.message);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.oParent) {` && |\n| &&
|
||||
` sap.z2ui5.oParent.removeAllPages();` && |\n| &&
|
||||
` sap.z2ui5.oParent.insertPage(oView);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` oView.placeAt("content")` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ;sap.ui.getCore().getMessageManager().registerObject(oView, true);` && |\n| &&
|
||||
` sap.z2ui5.oView = oView;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` , );` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW.CHECK_UPDATE_MODEL == true) {` && |\n| &&
|
||||
` var main_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` main_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` sap.z2ui5.oView.setModel(main_model);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.CHECK_UPDATE_MODEL == true) {` && |\n| &&
|
||||
` var nest_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` nest_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` sap.z2ui5.oViewNest.setModel(nest_model);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.CHECK_UPDATE_MODEL == true) {` && |\n| &&
|
||||
` var nest2_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` nest2_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` sap.z2ui5.oViewNest2.setModel(nest2_model);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_POPUP.CHECK_UPDATE_MODEL == true) {` && |\n| &&
|
||||
` sap.z2ui5.oViewPopup.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL));` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_POPOVER.CHECK_UPDATE_MODEL == true) {` && |\n| &&
|
||||
` sap.z2ui5.oViewPopover.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL));` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.oController.onAfterRendering();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_MSG_TOAST.TEXT !== '') {` && |\n| &&
|
||||
` sap.m.MessageToast.show(sap.z2ui5.oResponse.PARAMS.S_MSG_TOAST.TEXT);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_MSG_BOX.TEXT !== '') {` && |\n| &&
|
||||
` sap.m.MessageBox[sap.z2ui5.oResponse.PARAMS.S_MSG_BOX.TYPE](sap.z2ui5.oResponse.PARAMS.S_MSG_BOX.TEXT);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ,` && |\n| &&
|
||||
` readHttp: ()=>{` && |\n| &&
|
||||
|\n| &&
|
||||
` var xhr = new XMLHttpRequest();` && |\n| &&
|
||||
` xhr.open("POST", sap.z2ui5.pathname, true);` && |\n| &&
|
||||
` xhr.onload = (that)=>{` && |\n| &&
|
||||
` if (that.target.status !== 200) {` && |\n| &&
|
||||
` sap.z2ui5.oController.responseError(that.target.response);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` sap.z2ui5.oController.responseSuccess(that.target.response);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` xhr.send(JSON.stringify(sap.z2ui5.oBody));` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ,` && |\n| &&
|
||||
` Roundtrip: ()=>{` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.z2ui5.checkTimerActive = false;` && |\n| &&
|
||||
` sap.z2ui5.checkNestAfter = false;` && |\n| &&
|
||||
` sap.z2ui5.checkNestAfter2 = false;` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.z2ui5.oBody.OLOCATION = {` && |\n| &&
|
||||
` ORIGIN: window.location.origin,` && |\n| &&
|
||||
` PATHNAME: sap.z2ui5.pathname,` && |\n| &&
|
||||
` SEARCH: window.location.search,` && |\n| &&
|
||||
` VERSION: sap.ui.getVersionInfo().gav,` && |\n| &&
|
||||
` CHECK_LAUNCHPAD_ACTIVE: sap.ushell !== undefined,` && |\n| &&
|
||||
` STARTUP_PARAMETERS: sap.z2ui5.startupParameters,` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` if (sap.z2ui5.search) {` && |\n| &&
|
||||
` sap.z2ui5.oBody.OLOCATION.SEARCH = sap.z2ui5.search;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` if (sap.z2ui5.readOData) {` && |\n| &&
|
||||
` sap.z2ui5.readOData();` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` sap.z2ui5.oController.readHttp();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ,` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
|\n| &&
|
||||
` if (!sap.z2ui5) {` && |\n| &&
|
||||
` sap.z2ui5 = {};` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (!sap.z2ui5.pathname) {` && |\n| &&
|
||||
` sap.z2ui5.pathname = window.location.pathname;` && |\n| &&
|
||||
` // sap.z2ui5.pathname = ``/sap/bc/http/sap/y2ui5_http_handler``;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.checkNestAfter = false;` && |\n| &&
|
||||
` jQuery.sap.require("sap.ui.core.Fragment");` && |\n| &&
|
||||
` jQuery.sap.require("sap.m.MessageToast");` && |\n| &&
|
||||
` jQuery.sap.require("sap.m.MessageBox");` && |\n| &&
|
||||
` jQuery.sap.require("sap.ui.model.json.JSONModel");` && |\n| &&
|
||||
` var xml = atob('PA==') + 'mvc:View controllerName="z2ui5_controller" xmlns:mvc="sap.ui.core.mvc" /' + atob('Pg==');` && |\n| &&
|
||||
` var oView = sap.ui.xmlview({` && |\n| &&
|
||||
` viewContent: xml` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` sap.z2ui5.oController = oView.getController();` && |\n| &&
|
||||
` var oViewNest = sap.ui.xmlview({` && |\n| &&
|
||||
` viewContent: xml` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` var oViewNest2 = sap.ui.xmlview({` && |\n| &&
|
||||
` viewContent: xml` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` sap.z2ui5.oControllerNest = oViewNest.getController();` && |\n| &&
|
||||
` sap.z2ui5.oControllerNest2 = oViewNest.getController();` && |\n| &&
|
||||
` sap.z2ui5.oBody = {};` && |\n| &&
|
||||
` sap.z2ui5.oBody.APP_START = sap.z2ui5.APP_START;` && |\n| &&
|
||||
` sap.z2ui5.oController.Roundtrip();` && |\n| &&
|
||||
` sap.z2ui5.log = ()=>{` && |\n| &&
|
||||
` console.log(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ;` && |\n| &&
|
||||
` sap.z2ui5.oController.oUtil = {};` && |\n| &&
|
||||
` sap.z2ui5.oController.oUtil.oDate = {};` && |\n| &&
|
||||
` sap.z2ui5.oController.oUtil.oDate.createObject = (s)=>{` && |\n| &&
|
||||
` return new Date(s);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` jQuery.sap.declare("sap.z2ui5.Helper");` && |\n| &&
|
||||
` sap.z2ui5.onBeforeRoundtrip = [];` && |\n| &&
|
||||
` sap.z2ui5.Helper = {};` && |\n| &&
|
||||
` sap.z2ui5.Helper.DateCreateObject = (s=>new Date(s));` && |\n| &&
|
||||
` sap.z2ui5.Helper.DateAbapTimestampToDate = (sTimestamp=>new sap.gantt.misc.Format.abapTimestampToDate(sTimestamp));` && |\n| &&
|
||||
` sap.z2ui5.Helper.DateAbapDateToDateObject = (d=>new Date(d.slice(0, 4),(d[4] + d[5]) - 1,d[6] + d[7]));` && |\n| &&
|
||||
` sap.z2ui5.Helper.DateAbapDateTimeToDateObject = ((d,t='000000')=>new Date(d.slice(0, 4),(d[4] + d[5]) - 1,d[6] + d[7],t.slice(0, 2),t.slice(2, 4),t.slice(4, 6)));` && |\n| &&
|
||||
get_js( ) && |\n| &&
|
||||
` sap.z2ui5.JSON_MODEL_LIMIT = ` && json_model_limit && `;` && |\n| &&
|
||||
` sap.z2ui5.checkLogActive = ` && z2ui5_cl_util_func=>boolean_abap_2_json( check_logging ) && `;` && |\n| &&
|
||||
lv_add_js && |\n| &&
|
||||
|
@ -579,4 +130,474 @@ CLASS z2ui5_cl_fw_http_handler IMPLEMENTATION.
|
|||
ENDDO.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD get_js.
|
||||
|
||||
result = `sap.ui.core.BusyIndicator.show();` && |\n| &&
|
||||
`sap.ui.getCore().attachInit( () => {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.ui.controller("z2ui5_controller", {` && |\n| &&
|
||||
` async onAfterRendering() {` && |\n| &&
|
||||
` if (!sap.z2ui5.oResponse.PARAMS) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` const { S_POPUP, S_VIEW_NEST, S_VIEW_NEST2, S_POPOVER } = sap.z2ui5.oResponse.PARAMS;` && |\n| &&
|
||||
|\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| &&
|
||||
|\n| &&
|
||||
` if (S_POPUP.XML) {` && |\n| &&
|
||||
` sap.z2ui5.oController.PopupDestroy();` && |\n| &&
|
||||
` await this.displayFragment(S_POPUP.XML, 'oViewPopup');` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` if (!sap.z2ui5.checkNestAfter ) { 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) { if ( S_VIEW_NEST2.XML) {` && |\n| &&
|
||||
` sap.z2ui5.oController.NestViewDestroy2();` && |\n| &&
|
||||
` await this.displayNestedView(S_VIEW_NEST2.XML, 'oViewNest2', 'S_VIEW_NEST2');` && |\n| &&
|
||||
` sap.z2ui5.checkNestAfter2 = true;` && |\n| &&
|
||||
` }}` && |\n| &&
|
||||
|\n| &&
|
||||
` if (S_POPOVER.XML) {` && |\n| &&
|
||||
` await this.displayFragment(S_POPOVER.XML, 'oViewPopover', S_POPOVER.OPEN_BY_ID);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.ui.core.BusyIndicator.hide();` && |\n| &&
|
||||
|\n| &&
|
||||
` if (sap.z2ui5.isBusy) {` && |\n| &&
|
||||
` sap.z2ui5.isBusy = false;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.busyDialog) {` && |\n| &&
|
||||
` sap.z2ui5.busyDialog.close();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
` async displayFragment(xml, viewProp, openById) {` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` const oFragment = await sap.ui.core.Fragment.load({` && |\n| &&
|
||||
` definition: xml,` && |\n| &&
|
||||
` controller: sap.z2ui5.oController,` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
|\n| &&
|
||||
` let oview_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` oFragment.setModel(oview_model);` && |\n| &&
|
||||
|\n| &&
|
||||
` let oControl = openById ? this.getControlById(openById) : null;` && |\n| &&
|
||||
` if (oControl) {` && |\n| &&
|
||||
` oFragment.openBy(oControl);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` oFragment.open();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.z2ui5[viewProp] = oFragment;` && |\n| &&
|
||||
` } catch (e) {` && |\n| &&
|
||||
` console.error('Error loading fragment:', e);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
` async displayNestedView(xml, viewProp, viewNestId) {` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` const oView = await sap.ui.core.mvc.XMLView.create({` && |\n| &&
|
||||
` definition: xml,` && |\n| &&
|
||||
` controller: sap.z2ui5.oControllerNest,` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
|\n| &&
|
||||
` let oview_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` oView.setModel(oview_model);` && |\n| &&
|
||||
|\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| &&
|
||||
|\n| &&
|
||||
` sap.z2ui5[viewProp] = oView;` && |\n| &&
|
||||
` } catch (e) {` && |\n| &&
|
||||
` console.error('Error loading view:', e);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
` getControlById(id) {` && |\n| &&
|
||||
` let oControl = sap.ui.getCore().byId(id);` && |\n| &&
|
||||
` if (!oControl) {` && |\n| &&
|
||||
` oControl = sap.z2ui5.oView.byId(id) || sap.z2ui5.oViewNest.byId(id) || sap.z2ui5.oViewNest2.byId(id);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` return oControl;` && |\n| &&
|
||||
` },` && |\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| &&
|
||||
` ,` && |\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| &&
|
||||
` ,` && |\n| &&
|
||||
` NestViewDestroy() {` && |\n| &&
|
||||
` if (!sap.z2ui5.oViewNest) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.oViewNest.destroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ,` && |\n| &&
|
||||
` NestViewDestroy2() {` && |\n| &&
|
||||
` if (!sap.z2ui5.oViewNest2) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.oViewNest2.destroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ,` && |\n| &&
|
||||
` ViewDestroy() {` && |\n| &&
|
||||
` if (!sap.z2ui5.oView) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.oView.destroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ,` && |\n| &&
|
||||
` onEventFrontend(...args) {` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.z2ui5.onBeforeEventFrontend.forEach(item => {` && |\n| &&
|
||||
` if (item !== undefined) {` && |\n| &&
|
||||
` item(args);` && |\n| &&
|
||||
` } } )` && |\n| &&
|
||||
` ` && |\n| &&
|
||||
` switch (args[0].EVENT) {` && |\n| &&
|
||||
` case 'CROSS_APP_NAV_TO_PREV_APP':` && |\n| &&
|
||||
` let 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| &&
|
||||
` let navCon = sap.z2ui5.oView.byId(args[1]);` && |\n| &&
|
||||
` let 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.oViewNest.byId(args[2]);` && |\n| &&
|
||||
` navCon.to(navConTo);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ,` && |\n| &&
|
||||
|\n| &&
|
||||
` onEvent(...args) {` && |\n| &&
|
||||
` if (sap.z2ui5.isBusy) {` && |\n| &&
|
||||
` if (sap.z2ui5.isBusy == true) {` && |\n| &&
|
||||
` sap.z2ui5.busyDialog = new sap.m.BusyDialog();` && |\n| &&
|
||||
` sap.z2ui5.busyDialog.open();` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.isBusy = true;` && |\n| &&
|
||||
` if (!window.navigator.onLine) {` && |\n| &&
|
||||
` sap.m.MessageBox.alert('No internet connection! Please reconnect to the server and try again.');` && |\n| &&
|
||||
` sap.z2ui5.isBusy = false;` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.ui.core.BusyIndicator.show();` && |\n| &&
|
||||
` sap.z2ui5.oBody = {};` && |\n| &&
|
||||
` let isUpdated = false;` && |\n| &&
|
||||
` if (sap.z2ui5.oViewPopup) {` && |\n| &&
|
||||
` if (!sap.z2ui5.oViewPopup.isOpen || sap.z2ui5.oViewPopup.isOpen() == true) {` && |\n| &&
|
||||
` sap.z2ui5.oBody.EDIT = sap.z2ui5.oViewPopup.getModel().getData().EDIT;` && |\n| &&
|
||||
` isUpdated = true;` && |\n| &&
|
||||
` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (isUpdated == false) {` && |\n| &&
|
||||
` if (sap.z2ui5.oViewPopover) {` && |\n| &&
|
||||
` if (sap.z2ui5.oViewPopover.isOpen) {` && |\n| &&
|
||||
` if (sap.z2ui5.oViewPopover.isOpen() == true) {` && |\n| &&
|
||||
` sap.z2ui5.oBody.EDIT = sap.z2ui5.oViewPopover.getModel().getData().EDIT;` && |\n| &&
|
||||
` isUpdated = true;` && |\n| &&
|
||||
` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.oViewPopover.destroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (isUpdated == false) {` && |\n| &&
|
||||
` if (sap.z2ui5.oViewNest == this.getView()) {` && |\n| &&
|
||||
` sap.z2ui5.oBody.EDIT = sap.z2ui5.oViewNest.getModel().getData().EDIT;` && |\n| &&
|
||||
` sap.z2ui5.oBody.VIEWNAME = 'NEST';` && |\n| &&
|
||||
` isUpdated = true;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (isUpdated == false) {` && |\n| &&
|
||||
` sap.z2ui5.oBody.EDIT = sap.z2ui5.oView.getModel().getData().EDIT;` && |\n| &&
|
||||
` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.z2ui5.onBeforeRoundtrip.forEach(item => {` && |\n| &&
|
||||
` if (item !== undefined) {` && |\n| &&
|
||||
` item();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` )` && |\n| &&
|
||||
` if (args[0].CHECK_VIEW_DESTROY) {` && |\n| &&
|
||||
` sap.z2ui5.oController.ViewDestroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.oBody.ID = sap.z2ui5.oResponse.ID;` && |\n| &&
|
||||
` sap.z2ui5.oBody.ARGUMENTS = args;` && |\n| &&
|
||||
|\n| &&
|
||||
` if (sap.z2ui5.checkLogActive) {` && |\n| &&
|
||||
` console.log('Request Object:');` && |\n| &&
|
||||
` console.log(sap.z2ui5.oBody);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.oResponseOld = sap.z2ui5.oResponse;` && |\n| &&
|
||||
` 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[paramKey].CHECK_UPDATE_MODEL) {` && |\n| &&
|
||||
` let model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` oView.setModel(model);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` responseSuccess(response) {` && |\n| &&
|
||||
` sap.z2ui5.oResponse = response;` && |\n| &&
|
||||
|\n| &&
|
||||
` // Log response if logging is active` && |\n| &&
|
||||
` if (sap.z2ui5.checkLogActive) {` && |\n| &&
|
||||
` sap.z2ui5.oController.logResponse();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` // Handle view destroy` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW.CHECK_DESTROY) {` && |\n| &&
|
||||
` sap.z2ui5.oController.ViewDestroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` // Create new view if XML is provided` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW.XML !== '') {` && |\n| &&
|
||||
` sap.z2ui5.oController.ViewDestroy();` && |\n| &&
|
||||
` sap.z2ui5.oController.createView(sap.z2ui5.oResponse.PARAMS.S_VIEW.XML, sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` // Update models if needed` && |\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| &&
|
||||
|\n| &&
|
||||
` sap.z2ui5.oController.onAfterRendering();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` // Show message toasts and message boxes` && |\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| &&
|
||||
` },` && |\n| &&
|
||||
` showMessage(msgType, params) {` && |\n| &&
|
||||
` if (params[msgType].TEXT !== '') {` && |\n| &&
|
||||
` if (msgType === 'S_MSG_TOAST') {` && |\n| &&
|
||||
` sap.m.MessageToast.show(params[msgType].TEXT);` && |\n| &&
|
||||
` } else if (msgType === 'S_MSG_BOX') {` && |\n| &&
|
||||
` sap.m.MessageBox[params[msgType].TYPE](params[msgType].TEXT);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` logResponse() {` && |\n| &&
|
||||
|\n| &&
|
||||
` console.log('Response Object:', sap.z2ui5.oResponse);` && |\n| &&
|
||||
|\n| &&
|
||||
` // Destructure for easier access` && |\n| &&
|
||||
` const { S_VIEW, S_POPUP, S_POPOVER, S_VIEW_NEST, S_VIEW_NEST2 } = sap.z2ui5.oResponse.PARAMS;` && |\n| &&
|
||||
|\n| &&
|
||||
` // Helper function to log XML` && |\n| &&
|
||||
` const logXML = (label, xml) => {` && |\n| &&
|
||||
` if (xml !== '') {` && |\n| &&
|
||||
` console.log(``${label}:``, xml);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
|\n| &&
|
||||
` // Log different XML responses` && |\n| &&
|
||||
` logXML('UI5-XML-View', S_VIEW.XML);` && |\n| &&
|
||||
` logXML('UI5-XML-Popup', S_POPUP.XML);` && |\n| &&
|
||||
` logXML('UI5-XML-Popover', S_POPOVER.XML);` && |\n| &&
|
||||
` logXML('UI5-XML-Nest', S_VIEW_NEST.XML);` && |\n| &&
|
||||
` logXML('UI5-XML-Nest2', S_VIEW_NEST2.XML);` && |\n| &&
|
||||
|\n| &&
|
||||
` },` && |\n| &&
|
||||
` async createView(xml, viewModel) {` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` const oView = await sap.ui.core.mvc.XMLView.create({` && |\n| &&
|
||||
` definition: xml,` && |\n| &&
|
||||
` controller: sap.z2ui5.oController,` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
|\n| &&
|
||||
` let oview_model = new sap.ui.model.json.JSONModel(viewModel);` && |\n| &&
|
||||
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` oView.setModel(oview_model);` && |\n| &&
|
||||
|\n| &&
|
||||
` if (sap.z2ui5.oParent) {` && |\n| &&
|
||||
` sap.z2ui5.oParent.removeAllPages();` && |\n| &&
|
||||
` sap.z2ui5.oParent.insertPage(oView);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` oView.placeAt("content");` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.ui.getCore().getMessageManager().registerObject(oView, true);` && |\n| &&
|
||||
` sap.z2ui5.oView = oView;` && |\n| &&
|
||||
` } catch (e) {` && |\n| &&
|
||||
` sap.m.MessageBox.error('Error while creating View - ' + e.message);` && |\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| &&
|
||||
|\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.oController.responseSuccess(responseData);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
` Roundtrip() {` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.z2ui5.checkTimerActive = false;` && |\n| &&
|
||||
` sap.z2ui5.checkNestAfter = false;` && |\n| &&
|
||||
` sap.z2ui5.checkNestAfter2 = false;` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.z2ui5.oBody.OLOCATION = {` && |\n| &&
|
||||
` ORIGIN: window.location.origin,` && |\n| &&
|
||||
` PATHNAME: sap.z2ui5.pathname,` && |\n| &&
|
||||
` SEARCH: window.location.search,` && |\n| &&
|
||||
` VERSION: sap.ui.getVersionInfo().gav,` && |\n| &&
|
||||
` CHECK_LAUNCHPAD_ACTIVE: sap.ushell !== undefined,` && |\n| &&
|
||||
` STARTUP_PARAMETERS: sap.z2ui5.startupParameters,` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` if (sap.z2ui5.search) {` && |\n| &&
|
||||
` sap.z2ui5.oBody.OLOCATION.SEARCH = sap.z2ui5.search;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` if (sap.z2ui5.readOData) {` && |\n| &&
|
||||
` sap.z2ui5.readOData();` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` sap.z2ui5.oController.readHttp();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ,` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
|\n| &&
|
||||
` // Ensure sap.z2ui5 namespace exists and initialize properties` && |\n| &&
|
||||
` sap.z2ui5 = sap.z2ui5 || {};` && |\n| &&
|
||||
` sap.z2ui5.pathname = sap.z2ui5.pathname || '/sap/test';` && |\n| &&
|
||||
` sap.z2ui5.checkNestAfter = false;` && |\n| &&
|
||||
|\n| &&
|
||||
` // Require necessary SAP UI5 modules` && |\n| &&
|
||||
` jQuery.sap.require("sap.ui.core.Fragment");` && |\n| &&
|
||||
` jQuery.sap.require("sap.m.MessageToast");` && |\n| &&
|
||||
` jQuery.sap.require("sap.m.MessageBox");` && |\n| &&
|
||||
` jQuery.sap.require("sap.ui.model.json.JSONModel");` && |\n| &&
|
||||
|\n| &&
|
||||
` // Create views and controllers` && |\n| &&
|
||||
` const xml = atob('PA==') + 'mvc:View controllerName="z2ui5_controller" xmlns:mvc="sap.ui.core.mvc" /' + atob('Pg==');` && |\n| &&
|
||||
` const createViewAndController = (xmlContent) => {` && |\n| &&
|
||||
` const view = sap.ui.xmlview({ viewContent: xmlContent });` && |\n| &&
|
||||
` return { view, controller: view.getController() };` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
|\n| &&
|
||||
` const { controller: oController } = createViewAndController(xml);` && |\n| &&
|
||||
` const { controller: oControllerNest } = createViewAndController(xml);` && |\n| &&
|
||||
` const { controller: oControllerNest2 } = createViewAndController(xml);` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.z2ui5.oController = oController;` && |\n| &&
|
||||
` sap.z2ui5.oControllerNest = oControllerNest;` && |\n| &&
|
||||
` sap.z2ui5.oControllerNest2 = oControllerNest2;` && |\n| &&
|
||||
|\n| &&
|
||||
` // Helper functions` && |\n| &&
|
||||
` jQuery.sap.declare("sap.z2ui5.Helper");` && |\n| &&
|
||||
` sap.z2ui5.Helper = {` && |\n| &&
|
||||
` DateCreateObject: (s) => new Date(s),` && |\n| &&
|
||||
` DateAbapTimestampToDate: (sTimestamp) => new sap.gantt.misc.Format.abapTimestampToDate(sTimestamp),` && |\n| &&
|
||||
` DateAbapDateToDateObject: (d) => new Date(d.slice(0, 4), parseInt(d.slice(4, 6)) - 1, d.slice(6, 8)),` && |\n| &&
|
||||
` DateAbapDateTimeToDateObject: (d, t = '000000') => new Date(d.slice(0, 4), parseInt(d.slice(4, 6)) - 1, d.slice(6, 8), t.slice(0, 2), t.slice(2, 4), t.slice(4, 6))` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
|\n| &&
|
||||
` // Initialize other properties` && |\n| &&
|
||||
` sap.z2ui5.oBody = { APP_START: sap.z2ui5.APP_START };` && |\n| &&
|
||||
` sap.z2ui5.oController.Roundtrip();` && |\n| &&
|
||||
` ` && |\n| &&
|
||||
` sap.z2ui5.onBeforeRoundtrip = [];` && |\n| &&
|
||||
` sap.z2ui5.onBeforeEventFrontend = [];`.
|
||||
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
|
|
Loading…
Reference in New Issue
Block a user