From 2a0900bfdaef66da962b5041543e9ebe5bb46383 Mon Sep 17 00:00:00 2001 From: oblomov <102328295+oblomov-dev@users.noreply.github.com> Date: Sat, 15 Apr 2023 11:10:17 +0200 Subject: [PATCH] demos and ns (#179) * fixes * demos * namespace * abaplint fixes --- src/00/z2ui5_cl_app_demo_17.clas.abap | 12 ++++---- src/00/z2ui5_cl_app_demo_42.clas.abap | 12 ++++---- src/00/z2ui5_cl_app_demo_43.clas.abap | 43 +++++++++++++++++++++++++++ src/00/z2ui5_cl_app_demo_43.clas.xml | 16 ++++++++++ src/00/z2ui5_cl_xml_view.clas.abap | 36 +++++++++++----------- 5 files changed, 89 insertions(+), 30 deletions(-) create mode 100644 src/00/z2ui5_cl_app_demo_43.clas.abap create mode 100644 src/00/z2ui5_cl_app_demo_43.clas.xml diff --git a/src/00/z2ui5_cl_app_demo_17.clas.abap b/src/00/z2ui5_cl_app_demo_17.clas.abap index da2ec0a7..cc65d78a 100644 --- a/src/00/z2ui5_cl_app_demo_17.clas.abap +++ b/src/00/z2ui5_cl_app_demo_17.clas.abap @@ -60,11 +60,11 @@ CLASS Z2UI5_CL_APP_DEMO_17 IMPLEMENTATION. )->avatar( src = lcl_help=>get_avatar( ) class = 'sapUiTinyMarginEnd' )->title( text = 'Oblomov Dev' wrapping = abap_true ). - header_title->expanded_content( )->text( `abap2UI5 Developer` ). - header_title->snapped_Content( )->text( `abap2UI5 Developer` ). + header_title->expanded_content( ns = `uxap` )->text( `abap2UI5 Developer` ). + header_title->snapped_Content( ns = `uxap` )->text( `abap2UI5 Developer` ). header_title->snapped_Title_On_Mobile( )->title( `abap2UI5 Developer` ). - header_title->actions( )->overflow_toolbar( + header_title->actions( ns = `uxap` )->overflow_toolbar( )->overflow_toolbar_button( icon = `sap-icon://edit` text = 'edit header' @@ -113,7 +113,7 @@ CLASS Z2UI5_CL_APP_DEMO_17 IMPLEMENTATION. data(sections) = page->sections( ). sections->object_page_section( titleuppercase = abap_false id = 'goalsSectionSS1' title = '2014 Goals Plan' - )->heading( + )->heading( ns = `uxap` )->message_strip( text = 'this is a message strip' )->get_parent( )->sub_sections( @@ -145,7 +145,7 @@ CLASS Z2UI5_CL_APP_DEMO_17 IMPLEMENTATION. )->label( text = 'goals2'). sections->object_page_section( titleuppercase = abap_false id = 'PersonalSection' title = 'Personal' - )->heading( + )->heading( ns = `uxap` " )->message_strip( text = 'this is a message strip' )->get_parent( )->sub_sections( @@ -161,7 +161,7 @@ CLASS Z2UI5_CL_APP_DEMO_17 IMPLEMENTATION. sections->object_page_section( titleuppercase = abap_false id = 'employmentSection' title = 'Employment' - )->heading( + )->heading( ns = `uxap` " )->message_strip( text = 'this is a message strip' )->get_parent( )->sub_sections( diff --git a/src/00/z2ui5_cl_app_demo_42.clas.abap b/src/00/z2ui5_cl_app_demo_42.clas.abap index 282125bd..120d2187 100644 --- a/src/00/z2ui5_cl_app_demo_42.clas.abap +++ b/src/00/z2ui5_cl_app_demo_42.clas.abap @@ -59,11 +59,11 @@ CLASS Z2UI5_CL_APP_DEMO_42 IMPLEMENTATION. )->avatar( src = lcl_help=>get_avatar( ) class = 'sapUiTinyMarginEnd' )->title( text = 'Oblomov Dev' wrapping = abap_true ). - header_title->expanded_content( )->text( `abap2UI5 Developer` ). - header_title->snapped_Content( )->text( `abap2UI5 Developer` ). + header_title->expanded_content( ns = `uxap` )->text( `abap2UI5 Developer` ). + header_title->snapped_Content( ns = `uxap` )->text( `abap2UI5 Developer` ). header_title->snapped_Title_On_Mobile( )->title( `abap2UI5 Developer` ). - header_title->actions( )->overflow_toolbar( + header_title->actions( ns = `uxap` )->overflow_toolbar( )->overflow_toolbar_button( icon = `sap-icon://edit` text = 'edit header' @@ -111,7 +111,7 @@ CLASS Z2UI5_CL_APP_DEMO_42 IMPLEMENTATION. data(sections) = page->sections( ). sections->object_page_section( titleuppercase = abap_false id = 'goalsSectionSS1' title = '2014 Goals Plan' - )->heading( + )->heading( ns = `uxap` )->message_strip( text = 'this is a message strip' )->get_parent( )->sub_sections( @@ -143,7 +143,7 @@ CLASS Z2UI5_CL_APP_DEMO_42 IMPLEMENTATION. )->label( text = 'goals2'). sections->object_page_section( titleuppercase = abap_false id = 'PersonalSection' title = 'Personal' - )->heading( + )->heading( ns = `uxap` " )->message_strip( text = 'this is a message strip' )->get_parent( )->sub_sections( @@ -159,7 +159,7 @@ CLASS Z2UI5_CL_APP_DEMO_42 IMPLEMENTATION. sections->object_page_section( titleuppercase = abap_false id = 'employmentSection' title = 'Employment' - )->heading( + )->heading( ns = `uxap` " )->message_strip( text = 'this is a message strip' )->get_parent( )->sub_sections( diff --git a/src/00/z2ui5_cl_app_demo_43.clas.abap b/src/00/z2ui5_cl_app_demo_43.clas.abap new file mode 100644 index 00000000..78a9eed2 --- /dev/null +++ b/src/00/z2ui5_cl_app_demo_43.clas.abap @@ -0,0 +1,43 @@ +CLASS z2ui5_cl_app_demo_43 DEFINITION PUBLIC. + + PUBLIC SECTION. + + INTERFACES z2ui5_if_app. + +* TYPES: +* BEGIN OF t_flight, +* carrid TYPE string, +* connid TYPE string, +* fldate TYPE string, +* price TYPE string, +* END OF t_flight. +* DATA: mt_flight TYPE STANDARD TABLE OF t_flight. + +ENDCLASS. + + +CLASS z2ui5_cl_app_demo_43 IMPLEMENTATION. + + METHOD z2ui5_if_app~controller. + +* SELECT carrid connid fldate price FROM sflight INTO TABLE mt_flight. +* +* DATA(page) = z2ui5_cl_xml_view=>factory( )->page( +* )->scroll_container( height = '70%' vertical = abap_true +* )->table( items = client->_bind_one( mt_flight ) +* )->columns( +* )->column( )->text( 'Carrid' )->get_parent( +* )->column( )->text( 'Connid' )->get_parent( +* )->column( )->text( 'Fldate' )->get_parent( +* )->column( )->text( 'Price' )->get_parent( +* )->get_parent( +* )->items( )->column_list_item( )->cells( +* )->text( '{CARRID}' +* )->text( '{CONNID}' +* )->text( '{FLDATE}' +* )->text( '{PRICE}' ). +* +* client->set_next( VALUE #( xml_main = page->get_root( )->xml_get( ) ) ). + + ENDMETHOD. +ENDCLASS. diff --git a/src/00/z2ui5_cl_app_demo_43.clas.xml b/src/00/z2ui5_cl_app_demo_43.clas.xml new file mode 100644 index 00000000..90fe79c1 --- /dev/null +++ b/src/00/z2ui5_cl_app_demo_43.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_APP_DEMO_43 + E + documentation + 1 + X + X + X + + + + diff --git a/src/00/z2ui5_cl_xml_view.clas.abap b/src/00/z2ui5_cl_xml_view.clas.abap index c73a2645..6e8173e8 100644 --- a/src/00/z2ui5_cl_xml_view.clas.abap +++ b/src/00/z2ui5_cl_xml_view.clas.abap @@ -175,13 +175,25 @@ CLASS z2ui5_cl_xml_view DEFINITION METHODS expanded_content IMPORTING - ns TYPE clike DEFAULT `uxap` + ns TYPE clike RETURNING VALUE(result) TYPE REF TO z2ui5_cl_xml_view. METHODS snapped_content IMPORTING - ns TYPE clike DEFAULT `uxap` + ns TYPE clike + RETURNING + VALUE(result) TYPE REF TO z2ui5_cl_xml_view. + + METHODS heading + IMPORTING + ns TYPE clike + RETURNING + VALUE(result) TYPE REF TO z2ui5_cl_xml_view. + + METHODS actions + IMPORTING + ns TYPE clike RETURNING VALUE(result) TYPE REF TO z2ui5_cl_xml_view. @@ -197,12 +209,6 @@ CLASS z2ui5_cl_xml_view DEFINITION RETURNING VALUE(result) TYPE REF TO z2ui5_cl_xml_view. - METHODS actions - IMPORTING - ns TYPE clike DEFAULT `uxap` - RETURNING - VALUE(result) TYPE REF TO z2ui5_cl_xml_view. - METHODS avatar IMPORTING src TYPE clike OPTIONAL @@ -228,12 +234,6 @@ CLASS z2ui5_cl_xml_view DEFINITION RETURNING VALUE(result) TYPE REF TO z2ui5_cl_xml_view. - METHODS heading - IMPORTING - ns TYPE clike DEFAULT `uxap` - RETURNING - VALUE(result) TYPE REF TO z2ui5_cl_xml_view. - METHODS sub_sections RETURNING VALUE(result) TYPE REF TO z2ui5_cl_xml_view. @@ -1676,10 +1676,10 @@ CLASS z2ui5_cl_xml_view IMPLEMENTATION. name = `ObjectPageLayout` ns = `uxap` t_prop = VALUE #( - ( n = `showTitleInHeaderContent` v = _=>get_json_boolean( showTitleInHeaderContent ) ) - ( n = `showEditHeaderButton` v = _=>get_json_boolean( showEditHeaderButton ) ) - ( n = `editHeaderButtonPress` v = editHeaderButtonPress ) - ( n = `upperCaseAnchorBar` v = upperCaseAnchorBar ) + ( n = `showTitleInHeaderContent` v = _=>get_json_boolean( showTitleInHeaderContent ) ) + ( n = `showEditHeaderButton` v = _=>get_json_boolean( showEditHeaderButton ) ) + ( n = `editHeaderButtonPress` v = editHeaderButtonPress ) + ( n = `upperCaseAnchorBar` v = upperCaseAnchorBar ) ) ). ENDMETHOD.