Skip to content

Commit

Permalink
popup html
Browse files Browse the repository at this point in the history
  • Loading branch information
oblomov-dev committed Mar 10, 2024
1 parent 7c0f9a2 commit 8b65698
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/z2ui5_cl_demo_app_000.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
89 changes: 89 additions & 0 deletions src/z2ui5_cl_demo_app_149.clas.abap
Original file line number Diff line number Diff line change
@@ -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( `<h2>HTML Links</h2>` && |\n| &&
`<p>HTML links are defined with the a tag:</p>` && |\n| &&
|\n| &&
`<a href="https://www.w3schools.com">This is a link</a>` ).
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.
16 changes: 16 additions & 0 deletions src/z2ui5_cl_demo_app_149.clas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_DEMO_APP_149</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>popup - popup_html</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

0 comments on commit 8b65698

Please sign in to comment.