From 8b65698bbfd57063532488ebc71a2d4924ba0a7f Mon Sep 17 00:00:00 2001 From: "oblomov-dev@outlook.com" Date: Sun, 10 Mar 2024 21:09:32 +0000 Subject: [PATCH] popup html --- src/z2ui5_cl_demo_app_000.clas.abap | 8 +++ src/z2ui5_cl_demo_app_149.clas.abap | 89 +++++++++++++++++++++++++++++ src/z2ui5_cl_demo_app_149.clas.xml | 16 ++++++ 3 files changed, 113 insertions(+) create mode 100644 src/z2ui5_cl_demo_app_149.clas.abap create mode 100644 src/z2ui5_cl_demo_app_149.clas.xml diff --git a/src/z2ui5_cl_demo_app_000.clas.abap b/src/z2ui5_cl_demo_app_000.clas.abap index 7b3a299a..2c24875e 100644 --- a/src/z2ui5_cl_demo_app_000.clas.abap +++ b/src/z2ui5_cl_demo_app_000.clas.abap @@ -1124,6 +1124,14 @@ class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' ). + panel->generic_tile( + header = 'Popup Display HTML' + subheader = '' + press = client->_event( 'z2ui5_cl_demo_app_149' ) + mode = 'LineMode' + class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' + ). + page = page2->panel( expandable = abap_true expanded = client->_bind_edit( ms_check_expanded-version ) diff --git a/src/z2ui5_cl_demo_app_149.clas.abap b/src/z2ui5_cl_demo_app_149.clas.abap new file mode 100644 index 00000000..b7b4e08f --- /dev/null +++ b/src/z2ui5_cl_demo_app_149.clas.abap @@ -0,0 +1,89 @@ +CLASS z2ui5_cl_demo_app_149 DEFINITION PUBLIC. + + PUBLIC SECTION. + + INTERFACES z2ui5_if_app. + + DATA client TYPE REF TO z2ui5_if_client. + + METHODS ui5_display. + METHODS ui5_event. + METHODS ui5_callback. + + PROTECTED SECTION. + PRIVATE SECTION. +ENDCLASS. + + + +CLASS z2ui5_cl_demo_app_149 IMPLEMENTATION. + + + METHOD ui5_event. + + CASE client->get( )-event. + + WHEN 'POPUP'. + DATA(lo_app) = z2ui5_cl_popup_html=>factory( `

HTML Links

` && |\n| && + `

HTML links are defined with the a tag:

` && |\n| && + |\n| && + `This is a link` ). + client->nav_app_call( lo_app ). + + WHEN 'BACK'. + client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ). + + ENDCASE. + + ENDMETHOD. + + + METHOD ui5_display. + + DATA(view) = z2ui5_cl_xml_view=>factory( ). + view->shell( + )->page( + title = 'abap2UI5 - Popup HTML' + navbuttonpress = client->_event( val = 'BACK' ) + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) + )->header_content( + )->link( + text = 'Source_Code' + target = '_blank' + + )->get_parent( + )->button( + text = 'Open Popup...' + press = client->_event( 'POPUP' ) ). + + client->view_display( view->stringify( ) ). + + ENDMETHOD. + + + METHOD z2ui5_if_app~main. + + me->client = client. + + IF client->get( )-check_on_navigated = abap_true. + ui5_display( ). + ui5_callback( ). + RETURN. + ENDIF. + + ui5_event( ). + + ENDMETHOD. + + METHOD ui5_callback. + + TRY. + DATA(lo_prev) = client->get_app( client->get( )-s_draft-id_prev_app ). + DATA(lo_dummy) = CAST z2ui5_cl_popup_to_inform( lo_prev ). + client->message_box_display( `callback after popup to inform` ). + CATCH cx_root. + ENDTRY. + + ENDMETHOD. + +ENDCLASS. diff --git a/src/z2ui5_cl_demo_app_149.clas.xml b/src/z2ui5_cl_demo_app_149.clas.xml new file mode 100644 index 00000000..97c67a89 --- /dev/null +++ b/src/z2ui5_cl_demo_app_149.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_DEMO_APP_149 + E + popup - popup_html + 1 + X + X + X + + + +