From 2ebee1f190bacc23a4605a963e6327b8dc7fcf71 Mon Sep 17 00:00:00 2001
From: oblomov <102328295+oblomov-dev@users.noreply.github.com>
Date: Mon, 10 Apr 2023 10:02:16 +0200
Subject: [PATCH] update view extension (#146)
* view definition
* update view
* xml view
* bugfix startapp
* update view
* view update
* update view extensions
* view extension
---
src/00/z2ui5_cl_app_demo_00.clas.abap | 3 +-
src/00/z2ui5_cl_app_demo_07.clas.abap | 356 ++++++++++++++----
src/00/z2ui5_cl_app_demo_18.clas.abap | 18 +-
src/00/z2ui5_cl_app_demo_29.clas.abap | 116 +++++-
.../z2ui5_cl_app_demo_29.clas.locals_imp.abap | 136 +++++++
src/00/z2ui5_cl_xml_view_helper.clas.abap | 102 +++--
src/z2ui5_cl_http_handler.clas.abap | 199 +++-------
...z2ui5_cl_http_handler.clas.locals_imp.abap | 67 ++--
8 files changed, 660 insertions(+), 337 deletions(-)
create mode 100644 src/00/z2ui5_cl_app_demo_29.clas.locals_imp.abap
diff --git a/src/00/z2ui5_cl_app_demo_00.clas.abap b/src/00/z2ui5_cl_app_demo_00.clas.abap
index c7317b1f..31fdc939 100644
--- a/src/00/z2ui5_cl_app_demo_00.clas.abap
+++ b/src/00/z2ui5_cl_app_demo_00.clas.abap
@@ -10,7 +10,7 @@ ENDCLASS.
-CLASS Z2UI5_CL_APP_DEMO_00 IMPLEMENTATION.
+CLASS z2ui5_cl_app_demo_00 IMPLEMENTATION.
METHOD z2ui5_if_app~controller.
@@ -33,7 +33,6 @@ CLASS Z2UI5_CL_APP_DEMO_00 IMPLEMENTATION.
ENDCASE.
-
DATA(page) = z2ui5_cl_xml_view_helper=>factory(
)->page(
title = 'abap2UI5 - Demo Section'
diff --git a/src/00/z2ui5_cl_app_demo_07.clas.abap b/src/00/z2ui5_cl_app_demo_07.clas.abap
index e6289c1d..666a67a8 100644
--- a/src/00/z2ui5_cl_app_demo_07.clas.abap
+++ b/src/00/z2ui5_cl_app_demo_07.clas.abap
@@ -7,8 +7,8 @@ CLASS z2ui5_cl_app_demo_07 DEFINITION PUBLIC.
DATA mv_path TYPE string.
DATA mv_value TYPE string.
- DATA mv_popup_view TYPE string.
-
+ " DATA mv_popup_view TYPE string.
+ " DATA check_initialized TYPE abap_bool.
TYPES:
BEGIN OF ty_file,
selkz TYPE abap_bool,
@@ -22,23 +22,100 @@ CLASS z2ui5_cl_app_demo_07 DEFINITION PUBLIC.
DATA mt_file TYPE STANDARD TABLE OF ty_file WITH EMPTY KEY.
DATA ms_file_edit TYPE ty_file.
DATA ms_file_prev TYPE ty_file.
- data mv_set_prev_view type abap_bool.
+ " DATA mv_set_prev_view TYPE abap_bool.
+
PROTECTED SECTION.
+
+ DATA client TYPE REF TO z2ui5_if_client.
+ DATA:
+ BEGIN OF app,
+ check_initialized TYPE abap_bool,
+ view_main TYPE string,
+ view_popup TYPE string,
+ get TYPE z2ui5_if_client=>ty_s_get,
+ next TYPE z2ui5_if_client=>ty_s_next,
+ END OF app.
+ METHODS ui5_on_init.
+ METHODS ui5_on_event.
+
+ METHODS ui5_render_view_main
+ RETURNING
+ VALUE(r_result) TYPE string.
+
+ METHODS ui5_render_view_init
+ RETURNING
+ VALUE(r_result) TYPE string.
+
+ METHODS ui5_render_popup_descr
+ RETURNING
+ VALUE(r_result) TYPE string.
+
+ METHODS ui5_render_popup_data
+ RETURNING
+ VALUE(r_result) TYPE string.
+
+ METHODS ui5_get_ccontrol_file_upload
+ RETURNING
+ VALUE(result) TYPE string.
+
PRIVATE SECTION.
ENDCLASS.
-CLASS Z2UI5_CL_APP_DEMO_07 IMPLEMENTATION.
+CLASS z2ui5_cl_app_demo_07 IMPLEMENTATION.
METHOD z2ui5_if_app~controller.
- mv_popup_view = ''.
- mv_set_prev_view = ''.
+ me->client = client.
+ app-get = client->get( ).
+ app-view_popup = ``.
+
+ IF app-check_initialized = abap_false.
+ app-check_initialized = abap_true.
+ ui5_on_init( ).
+ ENDIF.
+
+ IF app-get-event IS NOT INITIAL.
+ ui5_on_event( ).
+ ENDIF.
+
+ CASE app-view_main.
+ WHEN 'INIT'.
+ app-next-xml_main = ui5_render_view_init( ).
+ WHEN 'MAIN'.
+ app-next-xml_main = ui5_render_view_main( ).
+ ENDCASE.
+
+ CASE app-view_popup.
+ WHEN 'DESCR'.
+ app-next-xml_popup = ui5_render_popup_descr( ).
+ WHEN 'DATA'.
+ app-next-xml_popup = ui5_render_popup_data( ).
+ ENDCASE.
+
+ client->set_next( app-next ).
+ CLEAR app-get.
+ CLEAR app-next.
+
+ ENDMETHOD.
+
+ METHOD ui5_on_init.
+
+ app-view_main = 'INIT'.
+ client->popup_message_toast( 'Custom Control for File Upload loaded' ).
+
+ ENDMETHOD.
+
+
+ METHOD ui5_on_event.
CASE client->get( )-event.
+ WHEN 'START'.
+ app-view_main = 'MAIN'.
+
WHEN 'DISPLAY'.
ms_file_prev = mt_file[ selkz = abap_true ].
@@ -58,22 +135,56 @@ CLASS Z2UI5_CL_APP_DEMO_07 IMPLEMENTATION.
WHEN 'POPUP_DESCR'.
ms_file_edit = mt_file[ selkz = abap_true ].
- mv_popup_view = 'POPUP_DESCR'.
- mv_set_prev_view = abap_true.
+ app-view_popup = 'DESCR'.
+ app-next-check_set_prev_view = abap_true.
WHEN 'POPUP_DATA'.
ms_file_edit = mt_file[ selkz = abap_true ].
- mv_popup_view = 'POPUP_DATA'.
- mv_set_prev_view = abap_true.
+ app-view_popup = 'DATA'.
+ app-next-check_set_prev_view = abap_true.
WHEN 'BACK'.
client->nav_app_leave( client->get_app( client->get( )-id_prev_app_stack ) ).
ENDCASE.
+ ENDMETHOD.
- DATA(lo_main) = z2ui5_cl_xml_view_helper=>factory( ).
- DATA(page) = lo_main->page(
+
+ METHOD ui5_render_view_init.
+
+ DATA(lo_view) = z2ui5_cl_xml_view_helper=>factory( check_shell = abap_false ns = VALUE #(
+ ( `xmlns:mvc="sap.ui.core.mvc"` )
+ ( `xmlns:m="sap.m"` )
+ ( `xmlns:z2ui5="z2ui5"` )
+ ( `xmlns:core="sap.ui.core"` )
+ ( `xmlns="http://www.w3.org/1999/xhtml"` )
+ ) ).
+
+ DATA(page) = lo_view->_generic( name = 'Shell' ns = 'm' )->page(
+ ns = 'm'
+ title = 'abap2UI5 - File Upload/Download'
+ navbuttonpress = client->_event( 'BACK' )
+ shownavbutton = abap_true
+ )->header_content( ns = 'm'
+ )->toolbar_spacer( ns = 'm'
+ )->link( ns = 'm' text = 'Demo' href = 'https://twitter.com/OblomovDev/status/1638487600930357248'
+ )->link( ns = 'm' text = 'Source_Code' href = client->get( )-url_source_code
+ )->get_parent( ).
+
+ page->text( ns = 'm' text = 'Custom Control for File Upload is now loaded.'
+ )->button( ns = 'm' text = 'continue' press = client->_event( 'START' )
+ )->zz_plain( ` `
+ ).
+
+ r_result = lo_view->get_root( )->xml_get( ).
+
+ ENDMETHOD.
+
+
+ METHOD ui5_render_view_main.
+
+ DATA(page) = z2ui5_cl_xml_view_helper=>factory( )->page(
title = 'abap2UI5 - File Upload/Download'
navbuttonpress = client->_event( 'BACK' )
shownavbutton = abap_true
@@ -121,64 +232,175 @@ CLASS Z2UI5_CL_APP_DEMO_07 IMPLEMENTATION.
)->text( '{DESCR}' ).
IF ms_file_prev-data IS NOT INITIAL.
- page->zz_html( '' ).
+ page->zz_plain( '' ).
CLEAR mv_value.
ENDIF.
- DATA(lo_popup) = z2ui5_cl_xml_view_helper=>factory( ).
-
- CASE mv_popup_view.
-
- WHEN 'POPUP_DESCR'.
-
- lo_popup = z2ui5_cl_xml_view_helper=>factory(
- )->dialog(
- title = 'Edit Description'
- icon = 'sap-icon://edit'
- )->content(
- )->text_area(
- height = '99%'
- width = '99%'
- value = client->_bind( ms_file_edit-descr )
- )->get_parent(
- )->footer( )->overflow_toolbar(
- )->toolbar_spacer(
- )->button(
- text = 'Cancel'
- press = client->_event( 'TEXTAREA_CANCEL' )
- )->button(
- text = 'Confirm'
- press = client->_event( 'TEXTAREA_DESCR_CONFIRM' )
- type = 'Emphasized' ).
-
-
- WHEN 'POPUP_DATA'.
-
- lo_popup = z2ui5_cl_xml_view_helper=>factory(
- )->dialog(
- stretch = abap_true
- title = 'Data:'
- )->content(
- )->text_area(
- height = '99%'
- width = '99%'
- enabled = abap_false
- value = client->_bind( ms_file_edit-data )
- )->get_parent(
- )->footer( )->overflow_toolbar(
- )->toolbar_spacer(
- )->button(
- text = 'close'
- press = client->_event( 'TEXTAREA_DATA_CONFIRM' )
- type = 'Emphasized' ).
-
- ENDCASE.
-
- client->set_next( VALUE #(
- xml_main = lo_main->get_root( )->xml_get( )
- xml_popup = lo_popup->get_root( )->xml_get( )
- check_set_prev_view = mv_set_prev_view
- ) ).
+ r_result = page->get_root( )->xml_get( ).
ENDMETHOD.
+
+
+ METHOD ui5_render_popup_descr.
+
+ DATA(lo_popup) = z2ui5_cl_xml_view_helper=>factory(
+ )->dialog(
+ title = 'Edit Description'
+ icon = 'sap-icon://edit'
+ )->content(
+ )->text_area(
+ height = '99%'
+ width = '99%'
+ value = client->_bind( ms_file_edit-descr )
+ )->get_parent(
+ )->footer( )->overflow_toolbar(
+ )->toolbar_spacer(
+ )->button(
+ text = 'Cancel'
+ press = client->_event( 'TEXTAREA_CANCEL' )
+ )->button(
+ text = 'Confirm'
+ press = client->_event( 'TEXTAREA_DESCR_CONFIRM' )
+ type = 'Emphasized' ).
+
+ r_result = lo_popup->get_root( )->xml_get( ).
+
+ ENDMETHOD.
+
+
+ METHOD ui5_render_popup_data.
+
+ DATA(lo_popup) = z2ui5_cl_xml_view_helper=>factory(
+ )->dialog(
+ stretch = abap_true
+ title = 'Data:'
+ )->content(
+ )->text_area(
+ height = '99%'
+ width = '99%'
+ enabled = abap_false
+ value = client->_bind( ms_file_edit-data )
+ )->get_parent(
+ )->footer( )->overflow_toolbar(
+ )->toolbar_spacer(
+ )->button(
+ text = 'close'
+ press = client->_event( 'TEXTAREA_DATA_CONFIRM' )
+ type = 'Emphasized' ).
+
+ r_result = lo_popup->get_root( )->xml_get( ).
+
+ ENDMETHOD.
+
+
+ METHOD ui5_get_ccontrol_file_upload.
+
+ result = ` jQuery.sap.declare("z2ui5.FileUploader");` && |\n| &&
+ |\n| &&
+ ` sap.ui.define([` && |\n| &&
+ ` "sap/ui/core/Control",` && |\n| &&
+ ` "sap/m/Button",` && |\n| &&
+ ` "sap/ui/unified/FileUploader"` && |\n| &&
+ ` ], function (Control, Button, FileUploader) {` && |\n| &&
+ ` "use strict";` && |\n| &&
+ |\n| &&
+ ` return Control.extend("z2ui5.FileUploader", {` && |\n| &&
+ |\n| &&
+ ` metadata: {` && |\n| &&
+ ` properties: {` && |\n| &&
+ ` value: {` && |\n| &&
+ ` type: "string",` && |\n| &&
+ ` defaultValue: ""` && |\n| &&
+ ` },` && |\n| &&
+ ` path: {` && |\n| &&
+ ` type: "string",` && |\n| &&
+ ` defaultValue: ""` && |\n| &&
+ ` },` && |\n| &&
+ ` tooltip: {` && |\n| &&
+ ` type: "string",` && |\n| &&
+ ` defaultValue: ""` && |\n| &&
+ ` },` && |\n| &&
+ ` fileType: {` && |\n| &&
+ ` type: "string",` && |\n| &&
+ ` defaultValue: ""` && |\n| &&
+ ` },` && |\n| &&
+ ` placeholder: {` && |\n| &&
+ ` type: "string",` && |\n| &&
+ ` defaultValue: ""` && |\n| &&
+ ` },` && |\n| &&
+ ` buttonText: {` && |\n| &&
+ ` type: "string",` && |\n| &&
+ ` defaultValue: "Upload"` && |\n| &&
+ ` },` && |\n| &&
+ ` enabled: {` && |\n| &&
+ ` type: "boolean",` && |\n| &&
+ ` defaultValue: true` && |\n| &&
+ ` },` && |\n| &&
+ ` multiple: {` && |\n| &&
+ ` type: "boolean",` && |\n| &&
+ ` defaultValue: false` && |\n| &&
+ ` }` && |\n| &&
+ ` },` && |\n| &&
+ |\n| &&
+ |\n| &&
+ ` aggregations: {` && |\n| &&
+ ` },` && |\n| &&
+ ` events: {` && |\n| &&
+ ` "upload": {` && |\n| &&
+ ` allowPreventDefault: true,` && |\n| &&
+ ` parameters: {}` && |\n| &&
+ ` }` && |\n| &&
+ ` },` && |\n| &&
+ ` renderer: null` && |\n| &&
+ ` },` && |\n| &&
+ |\n| &&
+ ` renderer: function (oRm, oControl) {` && |\n| &&
+ |\n| &&
+ ` oControl.oUploadButton = new Button({` && |\n| &&
+ ` text: oControl.getProperty("buttonText"),` && |\n| &&
+ ` enabled: oControl.getProperty("path") !== "",` && |\n| &&
+ ` press: function (oEvent) {` && |\n| &&
+ |\n| &&
+ ` this.setProperty("path", this.oFileUploader.getProperty("value"));` && |\n| &&
+ |\n| &&
+ ` var file = this.oFileUploader.oFileUpload.files[0];` && |\n| &&
+ ` var reader = new FileReader();` && |\n| &&
+ |\n| &&
+ ` reader.onload = function (evt) {` && |\n| &&
+ ` var vContent = evt.currentTarget.result;` && |\n| &&
+ ` this.setProperty("value", vContent);` && |\n| &&
+ ` this.fireUpload();` && |\n| &&
+ ` //this.getView().byId('picture' ).getDomRef().src = vContent;` && |\n| &&
+ ` }.bind(this)` && |\n| &&
+ |\n| &&
+ ` reader.readAsDataURL(file);` && |\n| &&
+ ` }.bind(oControl)` && |\n| &&
+ ` });` && |\n| &&
+ |\n| &&
+ ` oControl.oFileUploader = new FileUploader({` && |\n| &&
+ ` icon: "sap-icon://browse-folder",` && |\n| &&
+ ` iconOnly: true,` && |\n| &&
+ ` value: oControl.getProperty("path"),` && |\n| &&
+ ` placeholder: oControl.getProperty("placeholder"),` && |\n| &&
+ ` change: function (oEvent) {` && |\n| &&
+ ` var value = oEvent.getSource().getProperty("value");` && |\n| &&
+ ` this.setProperty("path", value);` && |\n| &&
+ ` if (value) {` && |\n| &&
+ ` this.oUploadButton.setEnabled();` && |\n| &&
+ ` } else {` && |\n| &&
+ ` this.oUploadButton.setEnabled(false);` && |\n| &&
+ ` }` && |\n| &&
+ ` this.oUploadButton.rerender();` && |\n| &&
+ ` }.bind(oControl)` && |\n| &&
+ ` });` && |\n| &&
+ |\n| &&
+ ` var hbox = new sap.m.HBox();` && |\n| &&
+ ` hbox.addItem(oControl.oFileUploader);` && |\n| &&
+ ` hbox.addItem(oControl.oUploadButton);` && |\n| &&
+ ` oRm.renderControl(hbox);` && |\n| &&
+ ` }` && |\n| &&
+ ` });` && |\n| &&
+ ` });`.
+ ENDMETHOD.
+
ENDCLASS.
diff --git a/src/00/z2ui5_cl_app_demo_18.clas.abap b/src/00/z2ui5_cl_app_demo_18.clas.abap
index 23c5516d..69be17f9 100644
--- a/src/00/z2ui5_cl_app_demo_18.clas.abap
+++ b/src/00/z2ui5_cl_app_demo_18.clas.abap
@@ -22,15 +22,15 @@ CLASS z2ui5_cl_app_demo_18 DEFINITION PUBLIC.
METHODS z2ui5_on_init.
METHODS z2ui5_on_event.
- METHODS z2ui5_on_view_main
+ METHODS z2ui5_render_view_main
RETURNING
VALUE(result) TYPE string.
- METHODS z2ui5_on_view_second
+ METHODS z2ui5_render_view_second
RETURNING
VALUE(result) TYPE string.
- METHODS z2ui5_on_popup_input
+ METHODS z2ui5_render_popup_input
RETURNING
VALUE(result) TYPE string.
@@ -66,15 +66,15 @@ CLASS z2ui5_cl_app_demo_18 IMPLEMENTATION.
"view rendering
CASE app-view_main.
WHEN 'VIEW_MAIN'.
- app-next-xml_main = z2ui5_on_view_main( ).
+ app-next-xml_main = z2ui5_render_view_main( ).
WHEN 'VIEW_SECOND'.
- app-next-xml_main = z2ui5_on_view_second( ).
+ app-next-xml_main = z2ui5_render_view_second( ).
ENDCASE.
"popup rendering
CASE app-view_popup.
WHEN 'POPUP_INPUT'.
- app-next-xml_popup = z2ui5_on_popup_input( ).
+ app-next-xml_popup = z2ui5_render_popup_input( ).
ENDCASE.
"set the data for the frontend
@@ -122,7 +122,7 @@ CLASS z2ui5_cl_app_demo_18 IMPLEMENTATION.
ENDMETHOD.
- METHOD z2ui5_on_view_main.
+ METHOD z2ui5_render_view_main.
result = z2ui5_cl_xml_view_helper=>factory(
)->page(
@@ -162,7 +162,7 @@ CLASS z2ui5_cl_app_demo_18 IMPLEMENTATION.
ENDMETHOD.
- METHOD z2ui5_on_view_second.
+ METHOD z2ui5_render_view_second.
result = z2ui5_cl_xml_view_helper=>factory(
)->page(
@@ -193,7 +193,7 @@ CLASS z2ui5_cl_app_demo_18 IMPLEMENTATION.
ENDMETHOD.
- METHOD z2ui5_on_popup_input.
+ METHOD z2ui5_render_popup_input.
result = z2ui5_cl_xml_view_helper=>factory( )->dialog(
title = 'Title'
diff --git a/src/00/z2ui5_cl_app_demo_29.clas.abap b/src/00/z2ui5_cl_app_demo_29.clas.abap
index 6c2bdb92..f1261976 100644
--- a/src/00/z2ui5_cl_app_demo_29.clas.abap
+++ b/src/00/z2ui5_cl_app_demo_29.clas.abap
@@ -4,6 +4,7 @@ CLASS z2ui5_cl_app_demo_29 DEFINITION PUBLIC.
INTERFACES z2ui5_if_app.
+ data mv_value type string.
DATA product TYPE string.
DATA quantity TYPE i.
@@ -12,14 +13,14 @@ CLASS z2ui5_cl_app_demo_29 DEFINITION PUBLIC.
DATA input41 TYPE string.
PROTECTED SECTION.
+ data client TYPE REF TO z2ui5_if_client.
DATA:
BEGIN OF app,
- client TYPE REF TO z2ui5_if_client,
check_initialized TYPE abap_bool,
view_main TYPE string,
view_popup TYPE string,
- s_get TYPE z2ui5_if_client=>ty_s_get,
- s_next TYPE z2ui5_if_client=>ty_s_next,
+ get TYPE z2ui5_if_client=>ty_s_get,
+ next TYPE z2ui5_if_client=>ty_s_next,
END OF app.
METHODS z2ui5_on_init.
@@ -36,8 +37,8 @@ CLASS Z2UI5_CL_APP_DEMO_29 IMPLEMENTATION.
METHOD z2ui5_if_app~controller.
- app-client = client.
- app-s_get = client->get( ).
+ me->client = client.
+ app-get = client->get( ).
app-view_popup = ``.
IF app-check_initialized = abap_false.
@@ -45,28 +46,31 @@ CLASS Z2UI5_CL_APP_DEMO_29 IMPLEMENTATION.
z2ui5_on_init( ).
ENDIF.
- IF app-s_get-event IS NOT INITIAL.
+ IF app-get-event IS NOT INITIAL.
z2ui5_on_event( ).
ENDIF.
z2ui5_on_render( ).
- client->set_next( app-s_next ).
- CLEAR app-s_get.
- CLEAR app-s_next.
+ client->set_next( app-next ).
+ CLEAR app-get.
+ CLEAR app-next.
ENDMETHOD.
METHOD z2ui5_on_event.
- CASE app-s_get-event.
+ CASE app-get-event.
WHEN 'POST'.
- app-client->popup_message_toast( app-s_get-event_data ).
+ client->popup_message_toast( app-get-event_data ).
+
+ WHEN 'MYCC'.
+ client->popup_message_toast( 'MYCC event ' && mv_value ).
WHEN 'BACK'.
- app-client->nav_app_leave( app-client->get_app( app-s_get-id_prev_app_stack ) ).
+ client->nav_app_leave( client->get_app( app-get-id_prev_app_stack ) ).
ENDCASE.
@@ -83,36 +87,108 @@ CLASS Z2UI5_CL_APP_DEMO_29 IMPLEMENTATION.
input21 = '40'.
input22 = '40'.
+ mv_value = 'test'.
+
ENDMETHOD.
METHOD z2ui5_on_render.
- app-s_next-xml_main = `` && |\n| &&
+ ` xmlns:z2ui5="z2ui5" xmlns:m="sap.m" xmlns="http://www.w3.org/1999/xhtml"` && |\n| &&
+ ` > ` && |\n| &&
+
`` && |\n| &&
+ `` &&
`` && |\n| &&
`` && |\n| &&
+ `` && |\n| &&
|\n| &&
`This is a heading
` && |\n| &&
`This is a paragraph.
` && |\n| &&
`My First JavaScript
` && |\n| &&
`` && |\n| &&
- `` && |\n| &&
- `` &&
+ ` ` &&
+* ` ` && |\n| &&
+
`` && |\n| &&
` ` && |\n| &&
- ``.
+ ``.
diff --git a/src/00/z2ui5_cl_app_demo_29.clas.locals_imp.abap b/src/00/z2ui5_cl_app_demo_29.clas.locals_imp.abap
new file mode 100644
index 00000000..03056145
--- /dev/null
+++ b/src/00/z2ui5_cl_app_demo_29.clas.locals_imp.abap
@@ -0,0 +1,136 @@
+*"* use this source file for the definition and implementation of
+*"* local helper classes, interface definitions and type
+*"* declarations
+class lcl_repository DEFINITION.
+
+PUBLIC SECTION.
+
+ class-METHODS get_js_barcode_lib
+ returning
+ value(result) type string.
+
+
+endclass.
+
+CLASS lcl_repository IMPLEMENTATION.
+
+ METHOD get_js_barcode_lib.
+
+ result = `` && |\n| &&
+ `!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable` &&
+`:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"obj` &&
+`ect"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){` &&
+`var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=7)}([function(t,e,n){"use strict";var r;function o(t,e,n){return e in t?` &&
+`Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(e,"__esModule",{value:!0});var i=e.SET_A=0,a=e.SET_B=1,u=e.SET_C=2,s=(e.SHIFT=98,e.START_A=103),f=e.START_B=104,c=e.START_C=105;e.MODULO=1` &&
+`03,e.STOP=106,e.FNC1=207,e.SET_BY_CODE=(o(r={},s,i),o(r,f,a),o(r,c,u),r),e.SWAP={101:i,100:a,99:u},e.A_START_CHAR=String.fromCharCode(208),e.B_START_CHAR=String.fromCharCode(209),e.C_START_CHAR=String.fromCharCode(210),e.A_CHARS="[\0-_È-Ï]",e.B_CHA` &&
+`RS="[ -È-Ï]",e.C_CHARS="(Ï*[0-9]{2}Ï*)",e.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,1001110110` &&
+`0,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3` &&
+`,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11` &&
+`100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111` &&
+`100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,1110101` &&
+`1110,11110101110,11010000100,1101001e4,11010011100,1100011101011]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n=200){i=t.shift()-105;var a=u.SWAP[i];voi` &&
+`d 0!==a?o=e.next(t,n+1,a):(r!==u.SET_A&&r!==u.SET_B||i!==u.SHIFT||(t[0]=r===u.SET_A?t[0]>95?t[0]-96:t[0]:t[0]<32?t[0]+96:t[0]),o=e.next(t,n+1,r))}else i=e.correctIndex(t,r),o=e.next(t,n+1,r);var s=i*n;return{result:e.getBar(i)+o.result,checksum:s+o` &&
+`.checksum}}}]),e}(a.default);e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e0?e.fontSize+e.textMargin:0)+e.marginTop+` &&
+`e.marginBottom}function u(t,e,n){if(n.displayValue&&ee&&(e=t[n].height);return e},e.getEncodingHeight=a,e.getBarcodePadding=u,e.calculateEncodingAttributes=function(t,e,n){for(var r=0;r=i(t);return e+String.fromCharCode(r?206:205)+u(t,r)}e.default=function(t){var e=void 0;i` &&
+`f(a(t).length>=2)e=r.C_START_CHAR+s(t);else{var n=o(t)>i(t);e=(n?r.A_START_CHAR:r.B_START_CHAR)+u(t,n)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,(function(t,e){return String.fromCharCode(203)+e}))}},function(t,e,n){"use strict";Object.defineProp` &&
+`erty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n0?` &&
+`(n=0,o.textAlign="left"):"right"==t.textAlign?(n=e.width-1,o.textAlign="right"):(n=e.width/2,o.textAlign="center"),o.fillText(e.text,n,r))}},{key:"moveCanvasDrawing",value:function(t){this.canvas.getContext("2d").translate(t.width,0)}},{key:"restor` &&
+`eCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),t}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n0&&(this.drawRect(a-e.width*i,r,e` &&
+`.width*i,e.height,t),i=0);i>0&&this.drawRect(a-e.width*(i-1),r,e.width*i,e.height,t)}},{key:"drawSVGText",value:function(t,e,n){var r,o,i=this.document.createElementNS(s,"text");e.displayValue&&(i.setAttribute("style","font:"+e.fontOptions+" "+e.fo` &&
+`ntSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(r=0,i.setAttribute("text-anchor","start")):"right"==e.textAlign?(r=n.width-1,i.setAttribute("text-anchor"` &&
+`,"end")):(r=n.width/2,i.setAttribute("text-anchor","middle")),i.setAttribute("x",r),i.setAttribute("y",o),i.appendChild(this.document.createTextNode(n.text)),t.appendChild(i))}},{key:"setSvgAttributes",value:function(t,e){var n=this.svg;n.setAttrib` &&
+`ute("width",t+"px"),n.setAttribute("height",e+"px"),n.setAttribute("x","0px"),n.setAttribute("y","0px"),n.setAttribute("viewBox","0 0 "+t+" "+e),n.setAttribute("xmlns",s),n.setAttribute("version","1.1"),n.setAttribute("style","transform: translate(` &&
+`0,0)")}},{key:"createGroup",value:function(t,e,n){var r=this.document.createElementNS(s,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}},{key:"setGroupOptions",value:function(t,e){t.setAttribute("style","fill:"` &&
+`+e.lineColor+";")}},{key:"drawRect",value:function(t,e,n,r,o){var i=this.document.createElementNS(s,"rect");return i.setAttribute("x",t),i.setAttribute("y",e),i.setAttribute("width",n),i.setAttribute("height",r),o.appendChild(i),i}}]),t}();e.defaul` &&
+`t=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;nm_root = lo_tree.
lo_tree->m_parent = lo_tree.
result = lo_tree.
- " result->mo_runtime = runtime.
+
+ if check_shell = abap_true.
+
+ result = result->_generic( 'Shell' ).
+
+ endif.
ENDMETHOD.
@@ -894,17 +896,10 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION.
result = result && ` ` && lr_ns->* && ` `.
ENDLOOP.
result = result && `>`.
- result = result && COND #( WHEN check_shell = abap_true THEN `` ).
ENDMETHOD.
- METHOD xml_get_end.
-
- result = COND #( WHEN check_shell = abap_true THEN `` ) && ``.
-
- ENDMETHOD.
-
METHOD header.
result = _generic(
@@ -986,6 +981,7 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION.
result = me.
_generic(
name = `Button`
+ ns = ns
t_prop = VALUE #(
( n = `press` v = press )
( n = `text` v = text )
@@ -1530,6 +1526,7 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION.
result = me.
_generic(
name = `Link`
+ ns = ns
t_prop = VALUE #(
( n = `text` v = text )
( n = `target` v = `_blank` )
@@ -1706,6 +1703,7 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION.
result = _generic(
name = `Page`
+ ns = ns
t_prop = VALUE #(
( n = `title` v = title )
( n = `showNavButton` v = _=>get_json_boolean( shownavbutton ) )
@@ -2014,6 +2012,7 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION.
result = me.
_generic(
name = `Text`
+ ns = ns
t_prop = VALUE #(
( n = `text` v = text )
( n = `class` v = class )
@@ -2060,7 +2059,7 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION.
result = me.
_generic(
ns = ns
- name = cond #( when ns = 'f' then 'title' else `Title` )
+ name = COND #( WHEN ns = 'f' THEN 'title' ELSE `Title` )
t_prop = VALUE #(
( n = `text` v = text )
( n = `wrapping` v = _=>get_json_boolean( wrapping ) )
@@ -2111,7 +2110,10 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION.
METHOD toolbar_spacer.
result = me.
- _generic( `ToolbarSpacer` ).
+ _generic(
+ name = `ToolbarSpacer`
+ ns = ns
+ ).
ENDMETHOD.
@@ -2150,13 +2152,13 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION.
RETURN.
ENDIF.
- result = xml_get_begin( check_shell ).
+ result = xml_get_begin( ).
LOOP AT t_child INTO DATA(lr_child).
result = result && CAST z2ui5_cl_xml_view_helper( lr_child )->xml_get( ).
ENDLOOP.
- result = result && xml_get_end( check_shell ).
+ result = result && ``.
RETURN.
ENDIF.
@@ -2165,6 +2167,9 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION.
WHEN `ZZHTML`.
result = mt_prop[ n = `VALUE` ]-v.
RETURN.
+ WHEN `ZZPLAIN`.
+ result = mt_prop[ n = `VALUE` ]-v.
+ RETURN.
ENDCASE.
DATA(lv_tmp2) = COND #( WHEN m_ns <> `` THEN |{ m_ns }:| ).
@@ -2205,31 +2210,6 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION.
ENDMETHOD.
-
- METHOD zz_html.
-
- SPLIT val AT `<` INTO TABLE DATA(lt_table).
-
- DATA(lv_html) = ``.
- lv_html = VALUE #( lt_table[ 1 ] OPTIONAL ).
-
- LOOP AT lt_table REFERENCE INTO DATA(lr_line) FROM 2.
- IF lr_line->*(1) = `/`.
- lv_html = `*.
- ELSE.
- lv_html = `*.
- ENDIF.
- ENDLOOP.
-
- result = me.
- _generic(
- name = `ZZHTML`
- t_prop = VALUE #( ( n = `VALUE` v = lv_html ) )
- ).
-
- ENDMETHOD.
-
-
METHOD _generic.
DATA(result2) = NEW z2ui5_cl_xml_view_helper( ).
@@ -2293,4 +2273,14 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION.
ENDMETHOD.
+ METHOD zz_plain.
+
+ result = me.
+ _generic(
+ name = `ZZPLAIN`
+ t_prop = VALUE #( ( n = `VALUE` v = val ) )
+ ).
+
+ ENDMETHOD.
+
ENDCLASS.
diff --git a/src/z2ui5_cl_http_handler.clas.abap b/src/z2ui5_cl_http_handler.clas.abap
index 85a7852f..27212845 100644
--- a/src/z2ui5_cl_http_handler.clas.abap
+++ b/src/z2ui5_cl_http_handler.clas.abap
@@ -58,7 +58,7 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
result = lo_runtime->request_end( ).
CATCH cx_root INTO DATA(x).
- lo_runtime = lo_runtime->set_app_system_error( x ).
+ lo_runtime = lo_runtime->set_app_system( x ).
CONTINUE.
ENDTRY.
@@ -108,8 +108,8 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
r_result = r_result && `` && |\n| &&
+ |\n| &&
+ `