New UI5 frontend (#1443)

* Refactoring due to added Component support, slightly fixed session handl (#1439)

* Refactoring due to added Component support, slightly fixed session handl

* Update src/01/02/z2ui5_cl_core_http_get.clas.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

---------

Co-authored-by: oblomov-dev <102328295+oblomov-dev@users.noreply.github.com>
Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* session fix + tokens

* update stateful error

* pagehide for ios devices, beforeunload for desktop and others (#1440)

* fixes

* fixes excpetions

* update

* lint fixes

* replaced root view with app for launchpad  compati

* fix missed latest changes in init - added again

* update index html

* update

* update app

* update

* Update src/01/02/z2ui5_cl_core_http_get.clas.locals_imp.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* Update src/01/02/z2ui5_cl_core_http_get.clas.locals_imp.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* fixes

* lint fixes

* update

* Update src/01/02/z2ui5_cl_core_app.clas.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* Update changelog.txt

* update

* Update src/01/02/z2ui5_cl_core_app.clas.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

---------

Co-authored-by: Michael Zinnöcker <29286643+mzinnoecker@users.noreply.github.com>
Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>
This commit is contained in:
oblomov-dev 2024-09-22 13:53:11 +02:00 committed by GitHub
parent 1c3d88fa6a
commit ef4494bdb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 1080 additions and 681 deletions

View File

@ -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
-------------------

View File

@ -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 ).
<dfies> = structdescr->get_ddic_field_list( ).

View File

@ -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.

View File

@ -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 <lt_range> TYPE STANDARD TABLE.
ASSIGN me->mr_range->* TO <lt_range>.
IF xsdbool( <lt_range> IS INITIAL ) = abap_true.
RETURN.
ENDIF.
result = `(`.
LOOP AT <lt_range> ASSIGNING FIELD-SYMBOL(<ls_range_item>).
ASSIGN COMPONENT 'SIGN' OF STRUCTURE <ls_range_item> TO FIELD-SYMBOL(<lv_sign>).
ASSIGN COMPONENT 'OPTION' OF STRUCTURE <ls_range_item> TO FIELD-SYMBOL(<lv_option>).
ASSIGN COMPONENT 'LOW' OF STRUCTURE <ls_range_item> TO FIELD-SYMBOL(<lv_low>).
ASSIGN COMPONENT 'HIGH' OF STRUCTURE <ls_range_item> TO FIELD-SYMBOL(<lv_high>).
IF sy-tabix <> 1.
result = |{ result } OR|.
ENDIF.
IF <lv_sign> = signs-excluding.
result = |{ result } NOT|.
ENDIF.
result = |{ result } { me->mv_fieldname }|.
CASE <lv_option>.
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 } { <lv_option> } { quote( <lv_low> ) }|.
WHEN options-between.
result = |{ result } BETWEEN { quote( <lv_low> ) } AND { quote( <lv_high> ) }|.
WHEN options-not_between.
result = |{ result } NOT BETWEEN { quote( <lv_low> ) } AND { quote( <lv_high> ) }|.
WHEN options-contains_pattern.
TRANSLATE <lv_low> USING '*%'.
result = |{ result } LIKE { quote( <lv_low> ) }|.
WHEN options-not_contains_pattern.
TRANSLATE <lv_low> USING '*%'.
result = |{ result } NOT LIKE { quote( <lv_low> ) }|.
ENDCASE.
ENDLOOP.
result = |{ result } )|.
ENDMETHOD.
METHOD quote.
out = |'{ replace( val = val
sub = `'`
with = `''`
occ = 0 ) }'|.
ENDMETHOD.
ENDCLASS.

View File

@ -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.

View File

@ -67,6 +67,9 @@ CLASS z2ui5_cl_core_json_srv IMPLEMENTATION.
ENDIF.
ASSIGN lr_attri->r_ref->* TO FIELD-SYMBOL(<val>).
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(<attribute>).
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 = <attribute> ).
WHEN z2ui5_if_core_types=>cs_bind_type-one_time.

View File

@ -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 = `<p>` && x2->get_text( ) && ` or <p> Please check if all generic data references are public attributes of your class`.
val = `<p>` && cx->get_text( ) && `<p>` && x2->get_text( ) && ` or <p> Please check if all generic data references are public attributes of your class`.
ENDTRY.
ENDTRY.

View File

@ -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.

View File

@ -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.
@ -38,12 +32,10 @@ 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
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` )
)
t_config = VALUE #(
* ( 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` )
( 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` ) )
)
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 = `<!DOCTYPE html>` && |\n| &&
`<html lang="en">` && |\n| &&
`<head>` && |\n| &&
@ -156,10 +138,30 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` <meta charset="UTF-8">` && |\n| &&
` <meta name="viewport" content="width=device-width, initial-scale=1.0">` && |\n| &&
` <meta http-equiv="X-UA-Compatible" content="IE=edge">` && |\n| &&
| <title>{ cs_config-t_param[ n = `TITLE` ]-v }</title> \n| &&
| <style>{ cs_config-t_param[ n = `STYLE` ]-v }</style> \n| &&
main_get_component_script( ) && |\n| &&
` <script id="sap-ui-bootstrap"`.
| <title> { cs_config-t_param[ n = 'TITLE' ]-v }</title> \n| &&
| <style> html, body, body > div, #container, #container-uiarea \{\n| &
| height: 100%;\n| &
| \}</style> \n| &&
`<script>` && |\n| &&
` function onInitComponent(){` && |\n| &&
` sap.ui.require.preload({` && |\n| &&
` "z2ui5/manifest.json": '` && NEW lcl_ui5_app( )->manifest_json( ) && ` ',` && |\n| &&
` "z2ui5/Component.js": function(){` && NEW lcl_ui5_app( )->component_js( ) && lv_add_js && | sap.z2ui5.JSON_MODEL_LIMIT = { cs_config-t_param[ n = 'SET_SIZE_LIMIT' ]-v };| && ` },` && |\n| &&
` "z2ui5/css/style.css": function(){` && NEW lcl_ui5_app( )->css_style_css( ) && `},` && |\n| &&
` "z2ui5/model/models.js": function(){` && NEW lcl_ui5_app( )->model_models_js( ) && `},` && |\n| &&
` "z2ui5/i18n/i18n.properties": '` && NEW lcl_ui5_app( )->i18n_i18n_properties( ) && `' ,` && |\n| &&
` "z2ui5/view/App.view.xml": '` && NEW lcl_ui5_app( )->view_app_xml( ) && `' ,` && |\n| &&
` "z2ui5/controller/App.controller.js": function(){` && NEW lcl_ui5_app( )->controller_app_js( ) && `},` && |\n| &&
` "z2ui5/view/View1.view.xml": '` && NEW lcl_ui5_app( )->view_view1_xml( ) && `' ,` && |\n| &&
` "z2ui5/controller/View1.controller.js": function(){` && NEW lcl_ui5_app( )->controller_view1_js( ) && `},` && |\n| &&
` });` && |\n| &&
` sap.ui.require(["sap/ui/core/ComponentSupport"], function(ComponentSupport){` && |\n| &&
` ComponentSupport.run();` && |\n| &&
` });` && |\n| &&
` }` && |\n| &&
`</script>` && |\n| &&
`<script id="sap-ui-bootstrap" data-sap-ui-resourceroots='{ "z2ui5": "./" }' data-sap-ui-oninit="onInitComponent" ` && |\n| &&
`data-sap-ui-compatVersion="edge" data-sap-ui-async="true" data-sap-ui-frameOptions="trusted" data-sap-ui-bindingSyntax="complex"`.
LOOP AT cs_config-t_config REFERENCE INTO DATA(lr_config).
result = result && | { lr_config->n }='{ lr_config->v }'|.
@ -168,19 +170,8 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
result = result &&
` ></script></head>` && |\n| &&
`<body class="sapUiBody sapUiSizeCompact" id="content">` && |\n| &&
` <div data-sap-ui-component data-name="z2ui5" id="content_container" data-id="container" data-handle-validation="true" data-settings=''{"id" : "z2ui5"}''></div>` && |\n| &&
`<abc/>` && |\n|.
DATA(lv_add_js) = get_js_cc_startup( ) && cs_config-custom_js.
result = result &&
| <script> sap.z2ui5 = sap.z2ui5 \|\| \{\} ; if ( typeof z2ui5 == "undefined" ) \{ var z2ui5 = \{\}; \}; \n| &&
| { get_js( ) } \n| &&
| { lv_add_js } \n| &&
| { z2ui5_cl_cc_debug_tool=>get_js( ) } \n| &&
| sap.z2ui5.JSON_MODEL_LIMIT = { cs_config-t_param[ n = `SET_SIZE_LIMIT` ]-v };| &&
* | sap.z2ui5.NAME_TWO_WAY_MODEL = "{ z2ui5_if_core_types=>cs_ui5-two_way_model }" ;| &&
| { z2ui5_cl_cc_debug_tool=>get_js( ) } \n| &&
| </script><abc/></body></html> |.
` <div data-sap-ui-component data-name="z2ui5" data-id="container" data-settings='{"id" : "z2ui5"}' data-handle-validation="true"></div>` && |\n| &&
` </body></html>`.
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 = `<script>` && |\n| &&
` function onInitComponent(){` && |\n| &&
` sap.ui.require.preload({` && |\n| &&
` "z2ui5/manifest.json": '{}', //todo define json` && |\n| &&
` "z2ui5/Component.js": function(){` && |\n| &&
` sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){` && |\n| &&
` return UIComponent.extend("z2ui5.Component", {` && |\n| &&
` metadata: { manifest: "json" },` && |\n| &&
` init: function(){` && |\n| &&
` UIComponent.prototype.init.apply(this, arguments);` && |\n| &&
` },` && |\n| &&
` destroy: function(){` && |\n| &&
` const sContextId = document.cookie.match(new RegExp("(^| )sap-contextid=([^;]+)"))?.at(2);` && |\n| &&
` if(sContextId){` && |\n| &&
` fetch(sap.z2ui5.pathname, {` && |\n| &&
` method: 'HEAD',` && |\n| &&
` headers: {` && |\n| &&
` 'sap-terminate': 'session',` && |\n| &&
` 'sap-contextid': sContextId,` && |\n| &&
` 'sap-contextid-accept': 'header'` && |\n| &&
` }` && |\n| &&
` });` && |\n| &&
` }` && |\n| &&
` UIComponent.prototype.destroy.apply(this, arguments);` && |\n| &&
` },` && |\n| &&
` });` && |\n| &&
` });` && |\n| &&
` }` && |\n| &&
` });` && |\n| &&
` sap.ui.require(["sap/ui/core/ComponentSupport"], function(ComponentSupport){` && |\n| &&
` ComponentSupport.run();` && |\n| &&
` });` && |\n| &&
` }` && |\n| &&
`</script>`.
ENDMETHOD.
ENDCLASS.

View File

@ -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 = `<mvc:View xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m" controllerName="z2ui5.controller.App">` &&
` <App id="viewContainer"></App>` &&
`</mvc:View>`.
ENDMETHOD.
METHOD view_view1_xml.
result = `<mvc:View controllerName="z2ui5.controller.View1"` &&
` xmlns:mvc="sap.ui.core.mvc" displayBlock="true"` &&
` xmlns="sap.m">` &&
`</mvc:View>`.
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.

View File

@ -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( ).

View File

@ -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,

View File

@ -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.

View File

@ -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| &&

View File

@ -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.

View File

@ -81,7 +81,18 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
attributes = attributes ).
ENDIF.
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.

View File

@ -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 )

View File

@ -8,26 +8,7 @@ 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
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
!multiinputname TYPE clike OPTIONAL
!change TYPE clike OPTIONAL
!addedtokens TYPE clike OPTIONAL
!removedtokens TYPE clike OPTIONAL
@ -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 ) ) ).

View File

@ -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'.

View File

@ -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.
@ -72,8 +69,7 @@ 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.
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

View File

@ -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,