From 68274ade6d17aa39a30dc7c19feafe9b45f6a928 Mon Sep 17 00:00:00 2001 From: "oblomov-dev@outlook.com" Date: Wed, 21 Feb 2024 11:08:20 +0000 Subject: [PATCH] refactoring --- src/z2ui5_cl_demo_app_000.clas.abap | 4 ++-- src/z2ui5_cl_demo_app_001.clas.abap | 1 - src/z2ui5_cl_demo_app_002.clas.abap | 9 +++------ src/z2ui5_cl_demo_app_003.clas.abap | 9 ++------- src/z2ui5_cl_demo_app_004.clas.abap | 11 +++-------- 5 files changed, 10 insertions(+), 24 deletions(-) diff --git a/src/z2ui5_cl_demo_app_000.clas.abap b/src/z2ui5_cl_demo_app_000.clas.abap index 8f57ef7c..93f540fe 100644 --- a/src/z2ui5_cl_demo_app_000.clas.abap +++ b/src/z2ui5_cl_demo_app_000.clas.abap @@ -40,7 +40,7 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION. CASE client->get( )-event. WHEN 'BACK'. - client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ). + client->nav_app_leave( ). WHEN OTHERS. TRY. @@ -61,7 +61,7 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION. shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) )->header_content( )->toolbar_spacer( - )->link( text = 'SCN' target = '_blank' href = 'https://blogs.sap.com/tag/abap2ui5/' + )->link( text = 'SCN' target = '_blank' href = 'https://community.sap.com/t5/technology-blogs-by-members/abap2ui5-1-introduction-developing-ui5-apps-purely-in-abap/ba-p/13567635' )->link( text = 'Twitter' target = '_blank' href = 'https://twitter.com/abap2UI5' )->link( text = 'GitHub' target = '_blank' href = 'https://github.com/oblomov-dev/abap2ui5' )->get_parent( ). diff --git a/src/z2ui5_cl_demo_app_001.clas.abap b/src/z2ui5_cl_demo_app_001.clas.abap index 1dd37c74..a20086f9 100644 --- a/src/z2ui5_cl_demo_app_001.clas.abap +++ b/src/z2ui5_cl_demo_app_001.clas.abap @@ -58,7 +58,6 @@ CLASS Z2UI5_CL_DEMO_APP_001 IMPLEMENTATION. WHEN 'BACK'. client->nav_app_leave( ). -* client->get_app( client->get( )-s_draft-id_prev_app_stack ) ). ENDCASE. diff --git a/src/z2ui5_cl_demo_app_002.clas.abap b/src/z2ui5_cl_demo_app_002.clas.abap index 424cd27c..bb598371 100644 --- a/src/z2ui5_cl_demo_app_002.clas.abap +++ b/src/z2ui5_cl_demo_app_002.clas.abap @@ -79,7 +79,7 @@ CLASS z2ui5_cl_demo_app_002 IMPLEMENTATION. CLEAR screen. client->message_toast_display( 'View initialized' ). WHEN 'BACK'. - client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ). + client->nav_app_leave( ). ENDCASE. @@ -118,12 +118,9 @@ CLASS z2ui5_cl_demo_app_002 IMPLEMENTATION. showheader = xsdbool( abap_false = client->get( )-check_launchpad_active ) title = 'abap2UI5 - Selection-Screen Example' navbuttonpress = client->_event( 'BACK' ) - shownavbutton = abap_true ). + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) + ). - page->header_content( - )->link( text = 'Demo' target = '_blank' href = `https://twitter.com/abap2UI5/status/1628701535222865922` - )->link( text = 'Source_Code' target = '_blank' href = z2ui5_cl_demo_utility=>factory( client )->app_get_url_source_code( ) - )->get_parent( ). DATA(grid) = page->grid( 'L6 M12 S12' )->content( 'layout' ). diff --git a/src/z2ui5_cl_demo_app_003.clas.abap b/src/z2ui5_cl_demo_app_003.clas.abap index 7d0c67be..60bbaa16 100644 --- a/src/z2ui5_cl_demo_app_003.clas.abap +++ b/src/z2ui5_cl_demo_app_003.clas.abap @@ -46,12 +46,7 @@ CLASS Z2UI5_CL_DEMO_APP_003 IMPLEMENTATION. )->page( title = 'abap2UI5 - List' navbuttonpress = client->_event( 'BACK' ) - shownavbutton = abap_true - )->header_content( - )->link( - text = 'Source_Code' target = '_blank' - href = z2ui5_cl_demo_utility=>factory( client )->app_get_url_source_code( ) - )->get_parent( ). + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ). page->list( headertext = 'List Ouput' @@ -79,7 +74,7 @@ CLASS Z2UI5_CL_DEMO_APP_003 IMPLEMENTATION. client->message_box_display( `go to details for item ` && lt_sel[ 1 ]-title ). WHEN 'BACK'. - client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ). + client->nav_app_leave( ). ENDCASE. ENDMETHOD. diff --git a/src/z2ui5_cl_demo_app_004.clas.abap b/src/z2ui5_cl_demo_app_004.clas.abap index c0ef047e..286b0a8d 100644 --- a/src/z2ui5_cl_demo_app_004.clas.abap +++ b/src/z2ui5_cl_demo_app_004.clas.abap @@ -51,7 +51,7 @@ CLASS z2ui5_cl_demo_app_004 IMPLEMENTATION. DATA(lv_dummy) = 1 / 0. WHEN 'BACK'. - client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ). + client->nav_app_leave( ). ENDCASE. @@ -67,13 +67,8 @@ CLASS z2ui5_cl_demo_app_004 IMPLEMENTATION. )->page( title = 'abap2UI5 - Controller' navbuttonpress = client->_event( val = 'BACK' check_view_destroy = abap_true ) - shownavbutton = abap_true - )->header_content( - )->link( - text = 'Source_Code' - href = z2ui5_cl_demo_utility=>factory( client )->app_get_url_source_code( ) - target = '_blank' - )->get_parent( ). + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) + ). page->grid( 'L6 M12 S12' )->content( 'layout' )->simple_form( 'Controller' )->content( 'form'