Skip to content

Commit

Permalink
update popups
Browse files Browse the repository at this point in the history
  • Loading branch information
oblomov-dev committed Mar 4, 2024
1 parent d06df23 commit 4dc7bac
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/z2ui5_cl_demo_app_000.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,13 @@ class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
).

panel->generic_tile(
header = 'Popup to Error'
press = client->_event( 'z2ui5_cl_demo_app_165' )
mode = 'LineMode'
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
).

panel->generic_tile(
header = 'Popup to Select'
press = client->_event( 'Z2UI5_CL_DEMO_APP_152' )
Expand Down
90 changes: 90 additions & 0 deletions src/z2ui5_cl_demo_app_165.clas.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
CLASS z2ui5_cl_demo_app_165 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_165 IMPLEMENTATION.


METHOD ui5_event.

CASE client->get( )-event.

WHEN 'POPUP'.
TRY.
DATA(lv_dummy) = 1 / 0.
CATCH cx_root INTO DATA(lx).
ENDTRY.
DATA(lo_app) = z2ui5_cl_popup_error=>factory( lx ).
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 Error'
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_165.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_165</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>popup - popup_error</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

0 comments on commit 4dc7bac

Please sign in to comment.