diff --git a/src/02/z2ui5_cl_demo_app_361.clas.abap b/src/02/z2ui5_cl_demo_app_361.clas.abap new file mode 100644 index 00000000..fc8bd5fe --- /dev/null +++ b/src/02/z2ui5_cl_demo_app_361.clas.abap @@ -0,0 +1,55 @@ +CLASS z2ui5_cl_demo_app_361 DEFINITION PUBLIC. + + PUBLIC SECTION. + INTERFACES z2ui5_if_app. + + PROTECTED SECTION. + PRIVATE SECTION. +ENDCLASS. + + +CLASS z2ui5_cl_demo_app_361 IMPLEMENTATION. + + METHOD z2ui5_if_app~main. + + IF client->check_on_init( ). + + DATA(view) = z2ui5_cl_util_xml=>factory( ). + DATA(root) = view->__( n = `View` ns = `mvc` + p = VALUE #( ( n = `displayBlock` v = abap_true ) + ( n = `height` v = `100%` ) + ( n = `xmlns` v = `sap.m` ) + ( n = `xmlns:mvc` v = `sap.ui.core.mvc` ) ) ). + + DATA(page) = root->__( `Shell` + )->__( n = `Page` + p = VALUE #( ( n = `navButtonPress` v = client->_event_nav_app_leave( ) ) + ( n = `showNavButton` v = client->check_app_prev_stack( ) ) + ( n = `title` v = `abap2UI5 - System Logout` ) ) ). + + page->__( `headerContent` + )->_( n = `Button` + p = VALUE #( ( n = `icon` v = `sap-icon://log` ) + ( n = `text` v = `Logout` ) + ( n = `tooltip` v = `Sign out of the current session` ) + ( n = `press` v = client->_event_client( client->cs_event-system_logout ) ) ) ). + + page->__( n = `MessageStrip` + p = VALUE #( ( n = `class` v = `sapUiMediumMargin` ) + ( n = `showIcon` v = abap_true ) + ( n = `text` v = `This demo shows the new system logout event. Pressing the button below triggers SYSTEM_LOGOUT on the client. Inside a Fiori Launchpad the shell container handles the sign-out; otherwise the app navigates to the ICF logoff endpoint.` ) + ( n = `type` v = `Information` ) ) + )->_( n = `Button` + p = VALUE #( ( n = `class` v = `sapUiSmallMargin` ) + ( n = `icon` v = `sap-icon://log` ) + ( n = `text` v = `Logout now` ) + ( n = `type` v = `Reject` ) + ( n = `press` v = client->_event_client( client->cs_event-system_logout ) ) ) ). + + client->view_display( view->stringify( ) ). + + ENDIF. + + ENDMETHOD. + +ENDCLASS. diff --git a/src/02/z2ui5_cl_demo_app_361.clas.xml b/src/02/z2ui5_cl_demo_app_361.clas.xml new file mode 100644 index 00000000..d2ccb964 --- /dev/null +++ b/src/02/z2ui5_cl_demo_app_361.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_DEMO_APP_361 + E + more - System Logout + 1 + X + X + X + + + + diff --git a/src/z2ui5_cl_demo_app_000.clas.abap b/src/z2ui5_cl_demo_app_000.clas.abap index 88bb2215..892a9fcb 100644 --- a/src/z2ui5_cl_demo_app_000.clas.abap +++ b/src/z2ui5_cl_demo_app_000.clas.abap @@ -238,6 +238,12 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION. mode = `LineMode` class = `sapUiTinyMarginEnd sapUiTinyMarginBottom` ). + panel->generic_tile( header = `System Logout` + subheader = `Trigger SYSTEM_LOGOUT client event` + press = client->_event( `z2ui5_cl_demo_app_361` ) + mode = `LineMode` + class = `sapUiTinyMarginEnd sapUiTinyMarginBottom` ). + panel = page->panel( expandable = abap_false expanded = abap_true headertext = `Messages` ).