From b2f49e7829024eb8226954ecd52610acfc119852 Mon Sep 17 00:00:00 2001 From: oblomov <102328295+oblomov-dev@users.noreply.github.com> Date: Thu, 13 Jun 2024 11:00:50 +0200 Subject: [PATCH 01/29] added new demos to overview 00 (#217) --- src/z2ui5_cl_demo_app_000.clas.abap | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/z2ui5_cl_demo_app_000.clas.abap b/src/z2ui5_cl_demo_app_000.clas.abap index a2e4e958..87c324c8 100644 --- a/src/z2ui5_cl_demo_app_000.clas.abap +++ b/src/z2ui5_cl_demo_app_000.clas.abap @@ -1247,12 +1247,28 @@ panel->generic_tile( header = 'Popup Display Layout' - subheader = '' + subheader = 'obsolet' press = client->_event( 'z2ui5_cl_demo_app_174' ) mode = 'LineMode' class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' ). + panel->generic_tile( + header = 'Popup Display Layout' + subheader = 'V2' + press = client->_event( 'z2ui5_cl_demo_app_200' ) + mode = 'LineMode' + class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' + ). + + panel->generic_tile( + header = 'Popup Display F4-Help' +* subheader = 'V2' + press = client->_event( 'z2ui5_cl_demo_app_204' ) + mode = 'LineMode' + class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' + ). + panel->generic_tile( header = 'Popup Display Download' subheader = '' From 8b79de874baa186c99ff94dfc445da6d436c0c6d Mon Sep 17 00:00:00 2001 From: oblomov <102328295+oblomov-dev@users.noreply.github.com> Date: Thu, 13 Jun 2024 14:21:20 +0200 Subject: [PATCH 02/29] fix f4 help (#218) --- src/z2ui5_cl_demo_app_204.clas.abap | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/z2ui5_cl_demo_app_204.clas.abap b/src/z2ui5_cl_demo_app_204.clas.abap index 14243e3c..c74e9605 100644 --- a/src/z2ui5_cl_demo_app_204.clas.abap +++ b/src/z2ui5_cl_demo_app_204.clas.abap @@ -5,7 +5,7 @@ CLASS z2ui5_cl_demo_app_204 DEFINITION PUBLIC SECTION. INTERFACES z2ui5_if_app. - DATA ms_t004 TYPE z2ui5_t004. + DATA mv_arbgb TYPE string. PROTECTED SECTION. DATA client TYPE REF TO z2ui5_if_client. @@ -53,7 +53,7 @@ CLASS z2ui5_cl_demo_app_204 IMPLEMENTATION. DATA(view) = z2ui5_cl_xml_view=>factory( ). "->shell( ). - DATA(page) = view->page( title = 'Layout' + DATA(page) = view->shell( )->page( title = 'Layout' navbuttonpress = client->_event( 'BACK' ) shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) class = 'sapUiContentPadding' ). @@ -62,12 +62,12 @@ CLASS z2ui5_cl_demo_app_204 IMPLEMENTATION. editable = abap_true )->content( 'form' )->text( - `Table Z2UI5_T004 field GUID is linked to table Z2UI5 field GUID via a foreign key link.` - )->label( `GUID` - )->input( value = client->_bind_edit( ms_t004-guid ) + `Table t100 field ARBGB is linked to table t100a field ARBGB via a foreign key link.` + )->label( `ARBGB` + )->input( value = client->_bind_edit( mv_arbgb ) showvaluehelp = abap_true valuehelprequest = client->_event( val = 'CALL_POPUP_F4' - t_arg = VALUE #( ( `GUID` ) ) ) ). + t_arg = VALUE #( ( `ARBGB` ) ) ) ). client->view_display( view->stringify( ) ). @@ -94,11 +94,11 @@ CLASS z2ui5_cl_demo_app_204 IMPLEMENTATION. mv_active_f4 = VALUE string( lt_arg[ 1 ] ). CASE mv_active_f4. - WHEN `GUID`. + WHEN `ARBGB`. - client->nav_app_call( z2ui5_cl_pop_f4_help=>factory( i_table = 'Z2UI5_T004' - i_fname = 'GUID' - i_value = CONV #( ms_t004-guid ) ) ). + client->nav_app_call( z2ui5_cl_pop_f4_help=>factory( i_table = 'T100' + i_fname = 'ARBGB' + i_value = CONV #( mv_arbgb ) ) ). WHEN OTHERS. ENDCASE. @@ -119,7 +119,7 @@ CLASS z2ui5_cl_demo_app_204 IMPLEMENTATION. CASE mv_active_f4. WHEN `GUID`. - ms_t004-guid = CONV #( app->mv_return_value ). + mv_arbgb = CONV #( app->mv_return_value ). WHEN OTHERS. From fad806730b1de9e1a98e00a1b063f07f7aedf48d Mon Sep 17 00:00:00 2001 From: abapsheep <135960093+abapsheep@users.noreply.github.com> Date: Thu, 13 Jun 2024 15:19:06 +0200 Subject: [PATCH 03/29] Update Samples Layout and F4-Help (#219) --- src/z2ui5_cl_demo_app_200.clas.xml | 2 +- src/z2ui5_cl_demo_app_204.clas.abap | 35 ++++++++++++----------------- src/z2ui5_cl_demo_app_204.clas.xml | 2 +- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/src/z2ui5_cl_demo_app_200.clas.xml b/src/z2ui5_cl_demo_app_200.clas.xml index 7e46653d..db023d4f 100644 --- a/src/z2ui5_cl_demo_app_200.clas.xml +++ b/src/z2ui5_cl_demo_app_200.clas.xml @@ -5,7 +5,7 @@ Z2UI5_CL_DEMO_APP_200 E - Table Layout + Layout 1 X X diff --git a/src/z2ui5_cl_demo_app_204.clas.abap b/src/z2ui5_cl_demo_app_204.clas.abap index c74e9605..cdfb5a56 100644 --- a/src/z2ui5_cl_demo_app_204.clas.abap +++ b/src/z2ui5_cl_demo_app_204.clas.abap @@ -11,8 +11,6 @@ CLASS z2ui5_cl_demo_app_204 DEFINITION DATA client TYPE REF TO z2ui5_if_client. DATA check_initialized TYPE abap_bool. - DATA mv_active_f4 TYPE string. - METHODS on_init. METHODS on_event. METHODS render_main. @@ -53,21 +51,21 @@ CLASS z2ui5_cl_demo_app_204 IMPLEMENTATION. DATA(view) = z2ui5_cl_xml_view=>factory( ). "->shell( ). - DATA(page) = view->shell( )->page( title = 'Layout' - navbuttonpress = client->_event( 'BACK' ) - shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) - class = 'sapUiContentPadding' ). + DATA(page) = view->shell( )->page( + title = 'Layout' + navbuttonpress = client->_event( 'BACK' ) + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) + class = 'sapUiContentPadding' ). page->simple_form( title = 'F4-Help' editable = abap_true )->content( 'form' - )->text( - `Table t100 field ARBGB is linked to table t100a field ARBGB via a foreign key link.` + )->text( `Table t100 field ARBGB is linked to table t100a field ARBGB via a foreign key link.` )->label( `ARBGB` )->input( value = client->_bind_edit( mv_arbgb ) showvaluehelp = abap_true valuehelprequest = client->_event( val = 'CALL_POPUP_F4' - t_arg = VALUE #( ( `ARBGB` ) ) ) ). + t_arg = VALUE #( ( `ARBGB` ) ( `T100` ) ) ) ). client->view_display( view->stringify( ) ). @@ -91,17 +89,12 @@ CLASS z2ui5_cl_demo_app_204 IMPLEMENTATION. DATA(lt_arg) = client->get( )-t_event_arg. - mv_active_f4 = VALUE string( lt_arg[ 1 ] ). - - CASE mv_active_f4. - WHEN `ARBGB`. + DATA(f4_field) = VALUE string( lt_arg[ 1 ] ). + DATA(f4_table) = VALUE string( lt_arg[ 2 ] ). - client->nav_app_call( z2ui5_cl_pop_f4_help=>factory( i_table = 'T100' - i_fname = 'ARBGB' - i_value = CONV #( mv_arbgb ) ) ). - WHEN OTHERS. - - ENDCASE. + client->nav_app_call( z2ui5_cl_pop_f4_help=>factory( i_table = f4_table + i_fname = f4_field + i_value = CONV #( mv_arbgb ) ) ). ENDMETHOD. @@ -116,8 +109,8 @@ CLASS z2ui5_cl_demo_app_204 IMPLEMENTATION. IF app->mv_return_value IS NOT INITIAL. - CASE mv_active_f4. - WHEN `GUID`. + CASE app->mv_field. + WHEN `ARBGB`. mv_arbgb = CONV #( app->mv_return_value ). diff --git a/src/z2ui5_cl_demo_app_204.clas.xml b/src/z2ui5_cl_demo_app_204.clas.xml index 743e41df..5723b0ac 100644 --- a/src/z2ui5_cl_demo_app_204.clas.xml +++ b/src/z2ui5_cl_demo_app_204.clas.xml @@ -5,7 +5,7 @@ Z2UI5_CL_DEMO_APP_204 E - Table Layout + F4-Help 1 X X From a24682a585878eacc47116f752079d5c0d7556d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Fri, 14 Jun 2024 15:13:27 -0600 Subject: [PATCH 04/29] Fix typo (#220) Removed extra letter "n" in word "mandatory". --- src/z2ui5_cl_demo_app_051.clas.abap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/z2ui5_cl_demo_app_051.clas.abap b/src/z2ui5_cl_demo_app_051.clas.abap index 82cb5474..ee683894 100644 --- a/src/z2ui5_cl_demo_app_051.clas.abap +++ b/src/z2ui5_cl_demo_app_051.clas.abap @@ -39,7 +39,7 @@ CLASS Z2UI5_CL_DEMO_APP_051 IMPLEMENTATION. shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ). DATA(layout) = page->vertical_layout( class = `sapUiContentPadding` width = `100%` ). - layout->label( text = 'Input mandantory' labelfor = `input1` ). + layout->label( text = 'Input mandatory' labelfor = `input1` ). layout->input( id = `input1` required = abap_true ). From ce64b7e72a38db91e8ecc466458c647741f95317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Fri, 14 Jun 2024 23:42:50 -0600 Subject: [PATCH 05/29] Fix typos in z2ui5_cl_demo_app_000 (#221) --- src/z2ui5_cl_demo_app_000.clas.abap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/z2ui5_cl_demo_app_000.clas.abap b/src/z2ui5_cl_demo_app_000.clas.abap index 87c324c8..97d7eba6 100644 --- a/src/z2ui5_cl_demo_app_000.clas.abap +++ b/src/z2ui5_cl_demo_app_000.clas.abap @@ -547,7 +547,7 @@ page = page2->panel( expandable = abap_true expanded = client->_bind_edit( ms_check_expanded-popups ) - headertext = `Popups & Popvers` ). + headertext = `Popups & Popovers` ). panel = page->panel( expandable = abap_false @@ -648,7 +648,7 @@ ). panel->generic_tile( - header = 'Planning Calender' + header = 'Planning Calendar' press = client->_event( 'Z2UI5_CL_DEMO_APP_080' ) mode = 'LineMode' class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' @@ -927,7 +927,7 @@ ). panel->generic_tile( - header = 'Tours & Contectual Help' + header = 'Tours & Contextual Help' subheader = 'driver.js' press = client->_event( 'z2ui5_cl_demo_app_119' ) mode = 'LineMode' From 65ff2ca5f861c8d524392734cb16aa66b3ec4b85 Mon Sep 17 00:00:00 2001 From: oblomov <102328295+oblomov-dev@users.noreply.github.com> Date: Sat, 15 Jun 2024 16:48:57 +0200 Subject: [PATCH 06/29] Update README.md (#222) --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 86260467..09da6fef 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,16 @@ ## Code Samples of abap2UI5 -_Running into problems or found a bug? Create an issue [here](https://github.com/abap2UI5/abap2UI5)_ -Information: -* install this repository and try out over 100 demo applications (install [**abap2UI5**](https://github.com/oblomov-dev/ABAP2UI5) before) +*...learn how to code with abap2UI5 using this repository. Try out various samples for any use case, such as tables, lists, trees, and many other UI5 controls. Quickly copy and paste the needed code into your own app to accelerate your development process and soon become an abap2UI5 expert!* 🤓
+ +**_Running into problems or found a bug? Create an issue [here](https://github.com/abap2UI5/abap2UI5)_**
+ +#### Information +* install this repository and try out over 200 sample applications (install [**abap2UI5**](https://github.com/oblomov-dev/ABAP2UI5) before) * if you have demos, feel free to share it, open a PR or add it to [**this list**](https://github.com/abap2UI5/abap2UI5-documentation/blob/main/docs/links.md) -* running into problems or found a bug? create an issue [**here**](https://github.com/abap2UI5/abap2UI5/issues) * use the downport-sample repository for lower releases [**here**](https://github.com/abap2UI5/abap2UI5-samples-downport) -Live Demo:
-https://abap2ui5.github.io/web-abap2ui5-samples/?app_start=z2ui5_cl_demo_app_000 +#### Demo +Check out the live demo [here.](https://abap2ui5.github.io/web-abap2ui5-samples/?app_start=z2ui5_cl_demo_app_000)

image From bef8d23c7634db6eebeaedf6b77e52a29b2aa4b8 Mon Sep 17 00:00:00 2001 From: oblomov <102328295+oblomov-dev@users.noreply.github.com> Date: Sat, 15 Jun 2024 19:59:18 +0200 Subject: [PATCH 07/29] README.md aktualisieren (#223) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 09da6fef..aa8123d0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Code Samples of abap2UI5 -*...learn how to code with abap2UI5 using this repository. Try out various samples for any use case, such as tables, lists, trees, and many other UI5 controls. Quickly copy and paste the needed code into your own app to accelerate your development process and soon become an abap2UI5 expert!* 🤓
+*...learn how to code with abap2UI5. Try out various samples for any use case, such as tables, lists, trees, and many other UI5 controls. Quickly copy and paste the needed code into your own app to accelerate your development process and soon become an abap2UI5 expert!* 🤓
**_Running into problems or found a bug? Create an issue [here](https://github.com/abap2UI5/abap2UI5)_**
From 9b621572cd9f55df6cdb1d1db2a0482986b7b0de Mon Sep 17 00:00:00 2001 From: oblomov <102328295+oblomov-dev@users.noreply.github.com> Date: Sat, 15 Jun 2024 22:26:29 +0200 Subject: [PATCH 08/29] Update README.md (#224) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aa8123d0..876202c0 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ *...learn how to code with abap2UI5. Try out various samples for any use case, such as tables, lists, trees, and many other UI5 controls. Quickly copy and paste the needed code into your own app to accelerate your development process and soon become an abap2UI5 expert!* 🤓
-**_Running into problems or found a bug? Create an issue [here](https://github.com/abap2UI5/abap2UI5)_**
+**_Running into problems or found a bug? Create an issue [here](https://github.com/abap2UI5/abap2UI5/issues)_**
#### Information * install this repository and try out over 200 sample applications (install [**abap2UI5**](https://github.com/oblomov-dev/ABAP2UI5) before) From f8de332b7da3ae6048508bae8696385e2c0a38ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Sun, 16 Jun 2024 00:31:20 -0600 Subject: [PATCH 09/29] Add "Confirm" and "Alert" samples to Z2UI5_CL_DEMO_APP_008 (#226) * Add "Confirm" and "Alert" samples to Z2UI5_CL_DEMO_APP_008 * Fix Typo and Consistency in Color Naming (z2ui5_cl_demo_app_002) --- src/z2ui5_cl_demo_app_002.clas.abap | 4 ++-- src/z2ui5_cl_demo_app_008.clas.abap | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/z2ui5_cl_demo_app_002.clas.abap b/src/z2ui5_cl_demo_app_002.clas.abap index bdd85448..188bbfba 100644 --- a/src/z2ui5_cl_demo_app_002.clas.abap +++ b/src/z2ui5_cl_demo_app_002.clas.abap @@ -141,7 +141,7 @@ CLASS Z2UI5_CL_DEMO_APP_002 IMPLEMENTATION. ( descr = 'Green' value = 'GREEN' ) ( descr = 'Blue' value = 'BLUE' ) ( descr = 'Black' value = 'BLACK' ) - ( descr = 'Grey' value = 'GREY' ) + ( descr = 'Gray' value = 'GRAY' ) ( descr = 'Blue2' value = 'BLUE2' ) ( descr = 'Blue3' value = 'BLUE3' ) ). @@ -165,7 +165,7 @@ CLASS Z2UI5_CL_DEMO_APP_002 IMPLEMENTATION. grid->simple_form( title = 'Input' editable = abap_true )->content( 'form' - )->label( 'Input with suggetion items' + )->label( 'Input with suggestion items' )->input( id = `suggInput` value = client->_bind_edit( screen-colour ) diff --git a/src/z2ui5_cl_demo_app_008.clas.abap b/src/z2ui5_cl_demo_app_008.clas.abap index 15250851..4a91808e 100644 --- a/src/z2ui5_cl_demo_app_008.clas.abap +++ b/src/z2ui5_cl_demo_app_008.clas.abap @@ -20,6 +20,12 @@ CLASS z2ui5_cl_demo_app_008 IMPLEMENTATION. CASE client->get( )-event. + WHEN 'BUTTON_MESSAGE_BOX_CONFIRM'. + client->message_box_display( text = 'Approve purchase order 12345?' type = 'confirm' ). + + WHEN 'BUTTON_MESSAGE_BOX_ALERT'. + client->message_box_display( text = 'The quantity you have reported exceeds the quantity planned.' type = 'alert' ). + WHEN 'BUTTON_MESSAGE_BOX'. client->message_box_display( 'this is a message box' ). @@ -75,6 +81,12 @@ CLASS z2ui5_cl_demo_app_008 IMPLEMENTATION. page->grid( 'L6 M12 S12' )->content( 'layout' )->simple_form( 'Message Box' )->content( 'form' + )->button( + text = 'Confirm' + press = client->_event( 'BUTTON_MESSAGE_BOX_CONFIRM' ) + )->button( + text = 'Alert' + press = client->_event( 'BUTTON_MESSAGE_BOX_ALERT' ) )->button( text = 'information' press = client->_event( 'BUTTON_MESSAGE_BOX' ) From 9661c96975ffd679b00147f2eaf19325c4e2ccc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Sun, 16 Jun 2024 00:36:53 -0600 Subject: [PATCH 10/29] Fix Typo and Inconsistency in Color Naming (z2ui5_cl_demo_app_002) (#228) Co-authored-by: oblomov <102328295+oblomov-dev@users.noreply.github.com> From e26c248fdead218d002bd2f7b42388580d140ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Sun, 16 Jun 2024 15:24:04 -0600 Subject: [PATCH 11/29] Adjust text in MessageBox samples (#229) --- src/z2ui5_cl_demo_app_008.clas.abap | 31 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/z2ui5_cl_demo_app_008.clas.abap b/src/z2ui5_cl_demo_app_008.clas.abap index 4a91808e..59f48242 100644 --- a/src/z2ui5_cl_demo_app_008.clas.abap +++ b/src/z2ui5_cl_demo_app_008.clas.abap @@ -26,17 +26,18 @@ CLASS z2ui5_cl_demo_app_008 IMPLEMENTATION. WHEN 'BUTTON_MESSAGE_BOX_ALERT'. client->message_box_display( text = 'The quantity you have reported exceeds the quantity planned.' type = 'alert' ). - WHEN 'BUTTON_MESSAGE_BOX'. - client->message_box_display( 'this is a message box' ). - WHEN 'BUTTON_MESSAGE_BOX_ERROR'. - client->message_box_display( text = 'this is a message box' type = 'error' ). + client->message_box_display( text = 'Select a team in the "Development" area.' && cl_abap_char_utilities=>cr_lf && + '"Marketing" isn’t assigned to this area.' type = 'error' ). - WHEN 'BUTTON_MESSAGE_BOX_SUCCESS'. - client->message_box_display( text = 'this is a message box' type = 'success' ). + WHEN 'BUTTON_MESSAGE_BOX_INFO'. + client->message_box_display( 'Your booking will be reserved for 24 hours.' ). WHEN 'BUTTON_MESSAGE_BOX_WARNING'. - client->message_box_display( text = 'this is a message box' type = 'warning' ). + client->message_box_display( text = 'The project schedule was last updated over a year ago.' type = 'warning' ). + + WHEN 'BUTTON_MESSAGE_BOX_SUCCESS'. + client->message_box_display( text = 'Project 1234567 was created and assigned to team "ABC".' type = 'success' ). WHEN 'BUTTON_MESSAGE_TOAST'. client->message_toast_display( 'this is a message toast' ). @@ -88,17 +89,17 @@ CLASS z2ui5_cl_demo_app_008 IMPLEMENTATION. text = 'Alert' press = client->_event( 'BUTTON_MESSAGE_BOX_ALERT' ) )->button( - text = 'information' - press = client->_event( 'BUTTON_MESSAGE_BOX' ) + text = 'Error' + press = client->_event( 'BUTTON_MESSAGE_BOX_ERROR' ) )->button( - text = 'success' - press = client->_event( 'BUTTON_MESSAGE_BOX_SUCCESS' ) + text = 'Info' + press = client->_event( 'BUTTON_MESSAGE_BOX_INFO' ) )->button( - text = 'error' - press = client->_event( 'BUTTON_MESSAGE_BOX_ERROR' ) + text = 'Warning' + press = client->_event( 'BUTTON_MESSAGE_BOX_WARNING' ) )->button( - text = 'warning' - press = client->_event( 'BUTTON_MESSAGE_BOX_WARNING' ) ). + text = 'Success' + press = client->_event( 'BUTTON_MESSAGE_BOX_SUCCESS' ) ). page->grid( 'L6 M12 S12' )->content( 'layout' From 61e4844f27c4b57252f483c33551f514808002bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Mon, 17 Jun 2024 00:25:38 -0600 Subject: [PATCH 12/29] Update Demo 110 (#230) * Update Demo 110 Changes based on MaskInput sample from UI5 Demo Kit. * Update text Changed "Mask Input" to "Unique ID" --- src/z2ui5_cl_demo_app_110.clas.abap | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/z2ui5_cl_demo_app_110.clas.abap b/src/z2ui5_cl_demo_app_110.clas.abap index e135e976..81bb103e 100644 --- a/src/z2ui5_cl_demo_app_110.clas.abap +++ b/src/z2ui5_cl_demo_app_110.clas.abap @@ -32,7 +32,7 @@ CLASS Z2UI5_CL_DEMO_APP_110 IMPLEMENTATION. DATA(view) = z2ui5_cl_xml_view=>factory( ). view->shell( )->page( - title = 'abap2UI5 - Popover Examples' + title = 'abap2UI5 - Sample: MaskInput' navbuttonpress = client->_event( val = 'BACK' ) shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) )->header_content( @@ -41,12 +41,12 @@ CLASS Z2UI5_CL_DEMO_APP_110 IMPLEMENTATION. text = 'Source_Code' target = '_blank' )->get_parent( - )->simple_form( title = 'Mask Input' layout = 'ColumnLayout' editable = abap_true + )->simple_form( title = 'Generic Mask Input' layout = 'ColumnLayout' editable = abap_true * )->content( 'form' - )->label( text = 'Mask Input' - )->mask_input( mask = '~~~~~~~~~~' placeholdersymbol = '_' placeholder = 'All characters allowed' )->get( + )->label( text = 'Unique ID' + )->mask_input( mask = `~~~~~~~~~~` placeholdersymbol = `_` placeholder = 'All characters allowed' )->get( )->rules( - )->mask_input_rule( maskformatsymbol = '~' regex = '"[^_]' + )->mask_input_rule( maskformatsymbol = '~' regex = `[^_]` )->get_parent( )->get_parent( )->get_parent( )->label( text = `Promo code` )->mask_input( mask = `**********` placeholdersymbol = `_` placeholder = `Latin characters (case insensitive) and numbers` )->get( @@ -65,7 +65,7 @@ CLASS Z2UI5_CL_DEMO_APP_110 IMPLEMENTATION. )->rules( )->mask_input_rule( maskformatsymbol = `C` regex = `[A-Z0-9]` )->get_parent( )->get_parent( )->get_parent( - )->label( text = `Product activation key"` + )->label( text = `Product activation key` )->mask_input( mask = `SAP-CCCCC-CCCCC` placeholdersymbol = `_` placeholder = `Starts with 'SAP' followed by digits and capital letters` showclearicon = abap_true )->get( )->rules( )->mask_input_rule( maskformatsymbol = `C` regex = `[A-Z0-9]` From 7cbee5f816542d6ff3e9310e4a6ee031aff72f8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Tue, 18 Jun 2024 11:57:29 -0600 Subject: [PATCH 13/29] Fixing 3 typos (#231) --- src/z2ui5_cl_demo_app_000.clas.abap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/z2ui5_cl_demo_app_000.clas.abap b/src/z2ui5_cl_demo_app_000.clas.abap index 97d7eba6..2447a993 100644 --- a/src/z2ui5_cl_demo_app_000.clas.abap +++ b/src/z2ui5_cl_demo_app_000.clas.abap @@ -253,7 +253,7 @@ page = page2->panel( expandable = abap_true expanded = client->_bind_edit( ms_check_expanded-input ) - headertext = `Input & Ouput` ). + headertext = `Input & Output` ). panel = page->panel( expandable = abap_false @@ -1247,7 +1247,7 @@ panel->generic_tile( header = 'Popup Display Layout' - subheader = 'obsolet' + subheader = 'obsolete' press = client->_event( 'z2ui5_cl_demo_app_174' ) mode = 'LineMode' class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' @@ -1409,7 +1409,7 @@ panel->generic_tile( - header = 'Object Page with Avator' + header = 'Object Page with Avatar' subheader = 'Since 1.73' press = client->_event( 'Z2UI5_CL_DEMO_APP_017' ) mode = 'LineMode' From 46de4b8f0c0b86db1319e9a0643672f9dcb59769 Mon Sep 17 00:00:00 2001 From: abapsheep <135960093+abapsheep@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:09:44 +0200 Subject: [PATCH 14/29] Update Layout (#233) Co-authored-by: Viktor Hoffmann --- src/z2ui5_cl_demo_app_200.clas.abap | 68 +++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 17 deletions(-) diff --git a/src/z2ui5_cl_demo_app_200.clas.abap b/src/z2ui5_cl_demo_app_200.clas.abap index 00d30f70..8559d174 100644 --- a/src/z2ui5_cl_demo_app_200.clas.abap +++ b/src/z2ui5_cl_demo_app_200.clas.abap @@ -8,6 +8,17 @@ CLASS z2ui5_cl_demo_app_200 DEFINITION DATA mt_table TYPE REF TO data. DATA ms_layout TYPE z2ui5_cl_pop_layout_v2=>ty_s_layout. + TYPES: + BEGIN OF ty_s_tab, + selkz TYPE abap_bool, + product TYPE string, + create_date TYPE string, + create_by TYPE string, + storage_location TYPE string, + quantity TYPE i, + END OF ty_s_tab. + TYPES ty_t_table TYPE STANDARD TABLE OF ty_s_tab WITH EMPTY KEY. + PROTECTED SECTION. DATA client TYPE REF TO z2ui5_if_client. DATA check_initialized TYPE abap_bool. @@ -54,7 +65,7 @@ CLASS z2ui5_cl_demo_app_200 IMPLEMENTATION. FIELD-SYMBOLS TYPE data. - DATA(view) = z2ui5_cl_xml_view=>factory( ). "->shell( ). + DATA(view) = z2ui5_cl_xml_view=>factory( )->shell( ). DATA(page) = view->page( title = 'Layout' navbuttonpress = client->_event( 'BACK' ) @@ -109,10 +120,33 @@ CLASS z2ui5_cl_demo_app_200 IMPLEMENTATION. )->cells( ). + " Subcolumns require new rendering.... LOOP AT ms_layout-t_layout REFERENCE INTO layout. - cells->object_identifier( text = |\{{ layout->fname }\}| ). + IF layout->t_sub_col IS NOT INITIAL. + + DATA(sub_col) = ``. + DATA(index) = 0. + LOOP AT layout->t_sub_col INTO DATA(subcol). + + index = index + 1. + + READ TABLE ms_layout-t_layout INTO DATA(line) WITH KEY fname = subcol-fname. + + IF index = 1. + sub_col = |{ line-tlabel }: \{{ subcol-fname }\}|. + ELSE. + sub_col = |{ sub_col }{ cl_abap_char_utilities=>cr_lf } { line-tlabel }: \{{ subcol-fname }\}|. + ENDIF. + + ENDLOOP. + cells->object_identifier( title = |\{{ layout->fname }\}| + text = sub_col ). + + ELSE. + cells->object_identifier( text = |\{{ layout->fname }\}| ). + ENDIF. ENDLOOP. client->view_display( view->stringify( ) ). @@ -134,26 +168,23 @@ CLASS z2ui5_cl_demo_app_200 IMPLEMENTATION. ENDMETHOD. METHOD get_data. - TYPES ty_t_01 TYPE STANDARD TABLE OF z2ui5_t_01. FIELD-SYMBOLS TYPE STANDARD TABLE. - TRY. - - CREATE DATA mt_table TYPE ty_t_01. - ASSIGN mt_table->* TO
. + CREATE DATA mt_table TYPE ty_t_table. + ASSIGN mt_table->* TO
. - SELECT id, - id_prev, - id_prev_app, - id_prev_app_stack, - uname - FROM z2ui5_t_01 - INTO CORRESPONDING FIELDS OF TABLE @
- UP TO 5 ROWS. +
= VALUE ty_t_table( create_date = `01.01.2023` + create_by = `Peter` + storage_location = `AREA_001` + quantity = 400 + ( product = 'table' ) + ( product = 'chair' ) + ( product = 'sofa' ) + ( product = 'computer' ) + ( product = 'oven' ) + ( product = 'table2' ) ). - CATCH cx_root. - ENDTRY. ENDMETHOD. METHOD init_layout. @@ -186,6 +217,9 @@ CLASS z2ui5_cl_demo_app_200 IMPLEMENTATION. ms_layout = app->ms_layout. +* subcolumns need rerendering to work .. +* render_main( ). +* for all other changes in Layout View Model Update is enough. client->view_model_update( ). CATCH cx_root. From 2dcf276672e461838b550468b616b0df47267905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Thu, 20 Jun 2024 10:47:40 -0600 Subject: [PATCH 15/29] Adjusting Title (#234) Changed from "App Finder" to "Sample: Nav Container" --- src/z2ui5_cl_demo_app_088.clas.abap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/z2ui5_cl_demo_app_088.clas.abap b/src/z2ui5_cl_demo_app_088.clas.abap index 2751f633..1897e048 100644 --- a/src/z2ui5_cl_demo_app_088.clas.abap +++ b/src/z2ui5_cl_demo_app_088.clas.abap @@ -62,7 +62,7 @@ CLASS z2ui5_cl_demo_app_088 IMPLEMENTATION. DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( )->page( navbuttonpress = client->_event( val = 'BACK' ) shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) - title = `abap2UI5 - App Finder` + title = `abap2UI5 - Sample: Nav Container` )->content( ). page->icon_tab_header( selectedkey = client->_bind_edit( mv_selected_key ) From 21fe8ce448516cd031a707e3676a1e873acf84eb Mon Sep 17 00:00:00 2001 From: oblomov <102328295+oblomov-dev@users.noreply.github.com> Date: Sun, 23 Jun 2024 14:59:31 +0200 Subject: [PATCH 16/29] reorganize sample section with popups (#235) --- src/z2ui5_cl_demo_app_000.clas.abap | 38 +++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/z2ui5_cl_demo_app_000.clas.abap b/src/z2ui5_cl_demo_app_000.clas.abap index 2447a993..1616a9e0 100644 --- a/src/z2ui5_cl_demo_app_000.clas.abap +++ b/src/z2ui5_cl_demo_app_000.clas.abap @@ -1245,17 +1245,17 @@ class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' ). - panel->generic_tile( - header = 'Popup Display Layout' - subheader = 'obsolete' - press = client->_event( 'z2ui5_cl_demo_app_174' ) - mode = 'LineMode' - class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' - ). +* panel->generic_tile( +* header = 'Popup Display Layout' +* subheader = 'obsolete' +* press = client->_event( 'z2ui5_cl_demo_app_174' ) +* mode = 'LineMode' +* class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' +* ). panel->generic_tile( header = 'Popup Display Layout' - subheader = 'V2' + subheader = '' press = client->_event( 'z2ui5_cl_demo_app_200' ) mode = 'LineMode' class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' @@ -1293,6 +1293,28 @@ class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' ). + panel = page->panel( + expandable = abap_false + expanded = abap_true + headertext = `Popups (ABAP for Cloud WIP)` + ). + + panel->generic_tile( + header = 'Popup with F4 Help' + subheader = '' + press = client->_event( 'z2ui5_cl_demo_app_204' ) + mode = 'LineMode' + class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' + ). + + panel->generic_tile( + header = 'Popup to Select Transport Requests' + subheader = '' + press = client->_event( 'z2ui5_cl_pop_transport' ) + mode = 'LineMode' + class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' + ). + page = page2->panel( expandable = abap_true expanded = client->_bind_edit( ms_check_expanded-version ) From fe9638497364eee498934058ae86cdd113901734 Mon Sep 17 00:00:00 2001 From: abapsheep <135960093+abapsheep@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:20:36 +0200 Subject: [PATCH 17/29] Sample Update (#236) Co-authored-by: Viktor Hoffmann --- src/z2ui5_cl_demo_app_200.clas.abap | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/z2ui5_cl_demo_app_200.clas.abap b/src/z2ui5_cl_demo_app_200.clas.abap index 8559d174..55992921 100644 --- a/src/z2ui5_cl_demo_app_200.clas.abap +++ b/src/z2ui5_cl_demo_app_200.clas.abap @@ -217,11 +217,13 @@ CLASS z2ui5_cl_demo_app_200 IMPLEMENTATION. ms_layout = app->ms_layout. -* subcolumns need rerendering to work .. -* render_main( ). -* for all other changes in Layout View Model Update is enough. - client->view_model_update( ). - + IF app->mv_rerender = abap_true. + " subcolumns need rerendering to work .. + render_main( ). + ELSE. + " for all other changes in Layout View Model Update is enough. + client->view_model_update( ). + ENDIF. CATCH cx_root. ENDTRY. From 47c560334de611f57e60a3a45810b31b09a1e8f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Thu, 27 Jun 2024 01:16:15 -0600 Subject: [PATCH 18/29] New Demo: Flex Box Basic Alignment (#237) * New Demo: Flex Box Basic Alignment 1 * New Demo Flex Box Basic Alignment 2 * New Demo Flex Box Basic Alignment 3 --------- Co-authored-by: oblomov <102328295+oblomov-dev@users.noreply.github.com> --- src/z2ui5_cl_demo_app_000.clas.abap | 9 ++ src/z2ui5_cl_demo_app_205.clas.abap | 127 ++++++++++++++++++++++++++++ src/z2ui5_cl_demo_app_205.clas.xml | 16 ++++ 3 files changed, 152 insertions(+) create mode 100644 src/z2ui5_cl_demo_app_205.clas.abap create mode 100644 src/z2ui5_cl_demo_app_205.clas.xml diff --git a/src/z2ui5_cl_demo_app_000.clas.abap b/src/z2ui5_cl_demo_app_000.clas.abap index 1616a9e0..eef42a38 100644 --- a/src/z2ui5_cl_demo_app_000.clas.abap +++ b/src/z2ui5_cl_demo_app_000.clas.abap @@ -714,6 +714,15 @@ ). + panel->generic_tile( + header = 'Flex Box' + subheader = 'Basic Alignment' + press = client->_event( 'Z2UI5_CL_DEMO_APP_205' ) + mode = 'LineMode' + class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' + ). + + panel = page->panel( expandable = abap_false expanded = abap_true diff --git a/src/z2ui5_cl_demo_app_205.clas.abap b/src/z2ui5_cl_demo_app_205.clas.abap new file mode 100644 index 00000000..95a5c78d --- /dev/null +++ b/src/z2ui5_cl_demo_app_205.clas.abap @@ -0,0 +1,127 @@ +class z2ui5_cl_demo_app_205 definition + public + create public . + +public section. + + interfaces IF_SERIALIZABLE_OBJECT . + interfaces Z2UI5_IF_APP . + + data CHECK_INITIALIZED type ABAP_BOOL . + PROTECTED SECTION. + + METHODS display_view + IMPORTING + client TYPE REF TO z2ui5_if_client. + METHODS on_event + IMPORTING + client TYPE REF TO z2ui5_if_client. + + PRIVATE SECTION. +ENDCLASS. + + + +CLASS z2ui5_cl_demo_app_205 IMPLEMENTATION. + + + METHOD DISPLAY_VIEW. + + DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( + )->page( + title = `abap2UI5 - Sample: Flex Box - Basic Alignment` + navbuttonpress = client->_event( 'BACK' ) + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ). + + DATA(layout) = page->vbox( + )->panel( headertext = `Upper left` + )->flex_box( height = `100px` + alignItems = `Start` + justifyContent = `Start` + )->button( text = `1` type = `Emphasized` class = `sapUiSmallMarginEnd` + )->button( text = `2` type = `Reject` class = `sapUiSmallMarginEnd` + )->button( text = `3` type = `Accept` )->get_parent( )->get_parent( + )->panel( headertext = `Upper center` + )->flex_box( height = `100px` + alignItems = `Start` + justifyContent = `Center` + )->button( text = `1` type = `Emphasized` class = `sapUiSmallMarginEnd` + )->button( text = `2` type = `Reject` class = `sapUiSmallMarginEnd` + )->button( text = `3` type = `Accept` )->get_parent( )->get_parent( + )->panel( headertext = `Upper right` + )->flex_box( height = `100px` + alignItems = `Start` + justifyContent = `End` + )->button( text = `1` type = `Emphasized` class = `sapUiSmallMarginEnd` + )->button( text = `2` type = `Reject` class = `sapUiSmallMarginEnd` + )->button( text = `3` type = `Accept` )->get_parent( )->get_parent( + )->panel( headertext = `Middle left` + )->flex_box( height = `100px` + alignItems = `Center` + justifyContent = `Start` + )->button( text = `1` type = `Emphasized` class = `sapUiSmallMarginEnd` + )->button( text = `2` type = `Reject` class = `sapUiSmallMarginEnd` + )->button( text = `3` type = `Accept` )->get_parent( )->get_parent( + )->panel( headertext = `Middle center` + )->flex_box( height = `100px` + alignItems = `Center` + justifyContent = `Center` + )->button( text = `1` type = `Emphasized` class = `sapUiSmallMarginEnd` + )->button( text = `2` type = `Reject` class = `sapUiSmallMarginEnd` + )->button( text = `3` type = `Accept` )->get_parent( )->get_parent( + )->panel( headertext = `Middle right` + )->flex_box( height = `100px` + alignItems = `Center` + justifyContent = `End` + )->button( text = `1` type = `Emphasized` class = `sapUiSmallMarginEnd` + )->button( text = `2` type = `Reject` class = `sapUiSmallMarginEnd` + )->button( text = `3` type = `Accept` )->get_parent( )->get_parent( + )->panel( headertext = `Lower left` + )->flex_box( height = `100px` + alignItems = `End` + justifyContent = `Start` + )->button( text = `1` type = `Emphasized` class = `sapUiSmallMarginEnd` + )->button( text = `2` type = `Reject` class = `sapUiSmallMarginEnd` + )->button( text = `3` type = `Accept` )->get_parent( )->get_parent( + )->panel( headertext = `Lower center` + )->flex_box( height = `100px` + alignItems = `End` + justifyContent = `Center` + )->button( text = `1` type = `Emphasized` class = `sapUiSmallMarginEnd` + )->button( text = `2` type = `Reject` class = `sapUiSmallMarginEnd` + )->button( text = `3` type = `Accept` )->get_parent( )->get_parent( + )->panel( headertext = `Lower right` + )->flex_box( height = `100px` + alignItems = `End` + justifyContent = `End` + )->button( text = `1` type = `Emphasized` class = `sapUiSmallMarginEnd` + )->button( text = `2` type = `Reject` class = `sapUiSmallMarginEnd` + )->button( text = `3` type = `Accept` + ). + + client->view_display( page->stringify( ) ). + + ENDMETHOD. + + + METHOD ON_EVENT. + + CASE client->get( )-event. + WHEN 'BACK'. + client->nav_app_leave( ). + ENDCASE. + + ENDMETHOD. + + + METHOD Z2UI5_IF_APP~MAIN. + + IF check_initialized = abap_false. + check_initialized = abap_true. + display_view( client ). + ENDIF. + + on_event( client ). + + ENDMETHOD. +ENDCLASS. diff --git a/src/z2ui5_cl_demo_app_205.clas.xml b/src/z2ui5_cl_demo_app_205.clas.xml new file mode 100644 index 00000000..a74d4979 --- /dev/null +++ b/src/z2ui5_cl_demo_app_205.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_DEMO_APP_205 + E + Flex Box - Basic Alignment + 1 + X + X + X + + + + From 3dff84a522e7302679fe80838b03ab954604f2a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Fri, 28 Jun 2024 00:37:07 -0600 Subject: [PATCH 19/29] New Sample based on Text - Max Lines from UI5 Demo Kit (#238) * Demo: Text - Max Lines (1) * Demo: Text - Max Lines (2) * Demo: Text - Max Lines (3) --- src/z2ui5_cl_demo_app_000.clas.abap | 8 +++ src/z2ui5_cl_demo_app_206.clas.abap | 95 +++++++++++++++++++++++++++++ src/z2ui5_cl_demo_app_206.clas.xml | 16 +++++ 3 files changed, 119 insertions(+) create mode 100644 src/z2ui5_cl_demo_app_206.clas.abap create mode 100644 src/z2ui5_cl_demo_app_206.clas.xml diff --git a/src/z2ui5_cl_demo_app_000.clas.abap b/src/z2ui5_cl_demo_app_000.clas.abap index eef42a38..381df402 100644 --- a/src/z2ui5_cl_demo_app_000.clas.abap +++ b/src/z2ui5_cl_demo_app_000.clas.abap @@ -291,6 +291,14 @@ class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' ). + panel->generic_tile( + header = 'Text' + subheader = 'Max Lines' + press = client->_event( 'Z2UI5_CL_DEMO_APP_206' ) + mode = 'LineMode' + class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' + ). + panel = page->panel( expandable = abap_false expanded = abap_true diff --git a/src/z2ui5_cl_demo_app_206.clas.abap b/src/z2ui5_cl_demo_app_206.clas.abap new file mode 100644 index 00000000..68ceadf3 --- /dev/null +++ b/src/z2ui5_cl_demo_app_206.clas.abap @@ -0,0 +1,95 @@ +class z2ui5_cl_demo_app_206 definition + public + create public . + +public section. + + interfaces IF_SERIALIZABLE_OBJECT . + interfaces Z2UI5_IF_APP . + + data CHECK_INITIALIZED type ABAP_BOOL . + PROTECTED SECTION. + + METHODS display_view + IMPORTING + client TYPE REF TO z2ui5_if_client. + + METHODS on_event + IMPORTING + client TYPE REF TO z2ui5_if_client. + + PRIVATE SECTION. +ENDCLASS. + + + +CLASS z2ui5_cl_demo_app_206 IMPLEMENTATION. + + + METHOD DISPLAY_VIEW. + + DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( + )->page( + title = 'abap2UI5 - Sample: Text - Max Lines' + navbuttonpress = client->_event( 'BACK' ) + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ). + + DATA(layout) = page->vertical_layout( class = `sapUiContentPadding` width = `100%` ). + + layout->text( text = `Lorem ipsum dolor st amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ` && + `At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ` && + `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ` && + `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat` )->get_parent( )->get_parent( ). + + layout->text( maxlines = `4` text = `4 Maxlines ... Lorem ipsum dolor st amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ` && + `At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ` && + `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ` && + `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat` ) . + + layout->text( maxlines = `3` text = `3 Maxlines ... Lorem ipsum dolor st amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ` && + `At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ` && + `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ` && + `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat` ) . + + layout->text( maxlines = `2` text = `2 Maxlines ... Lorem ipsum dolor st amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ` && + `At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ` && + `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ` && + `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat` ) . + + layout->text( wrapping = abap_false text = `Lorem ipsum dolor st amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ` && + `At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ` && + `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ` && + `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat` ) . + + layout->message_strip( type = `Warning` + text = `Note: The multi line overflow indicator depends on the browser line clamping support. ` && + `For such browsers this will be shown as ellipsis, for the other browsers the overflow will just be hidden.` ). + + client->view_display( page->stringify( ) ). + + ENDMETHOD. + + + METHOD ON_EVENT. + + CASE client->get( )-event. + + WHEN 'BACK'. + client->nav_app_leave( ). + + ENDCASE. + + ENDMETHOD. + + + METHOD Z2UI5_IF_APP~MAIN. + + IF check_initialized = abap_false. + check_initialized = abap_true. + display_view( client ). + ENDIF. + + on_event( client ). + + ENDMETHOD. +ENDCLASS. diff --git a/src/z2ui5_cl_demo_app_206.clas.xml b/src/z2ui5_cl_demo_app_206.clas.xml new file mode 100644 index 00000000..edb1ac72 --- /dev/null +++ b/src/z2ui5_cl_demo_app_206.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_DEMO_APP_206 + E + Text - Max Lines + 1 + X + X + X + + + + From bf721a5444c00b7ab854bac8cc74c73b7d16dc5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Sat, 29 Jun 2024 01:35:56 -0600 Subject: [PATCH 20/29] New Demo for Radio Button and adjusting Demo 206 (#239) --- src/z2ui5_cl_demo_app_000.clas.abap | 14 ++++- src/z2ui5_cl_demo_app_206.clas.abap | 2 +- src/z2ui5_cl_demo_app_207.clas.abap | 94 +++++++++++++++++++++++++++++ src/z2ui5_cl_demo_app_207.clas.xml | 16 +++++ 4 files changed, 122 insertions(+), 4 deletions(-) create mode 100644 src/z2ui5_cl_demo_app_207.clas.abap create mode 100644 src/z2ui5_cl_demo_app_207.clas.xml diff --git a/src/z2ui5_cl_demo_app_000.clas.abap b/src/z2ui5_cl_demo_app_000.clas.abap index 381df402..da9bb518 100644 --- a/src/z2ui5_cl_demo_app_000.clas.abap +++ b/src/z2ui5_cl_demo_app_000.clas.abap @@ -24,11 +24,11 @@ PROTECTED SECTION. PRIVATE SECTION. - ENDCLASS. +ENDCLASS. - CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION. +CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION. METHOD z2ui5_if_app~main. @@ -348,6 +348,14 @@ class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' ). + + panel->generic_tile( + header = 'Radio Button' + press = client->_event( 'Z2UI5_CL_DEMO_APP_207' ) + mode = 'LineMode' + class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' + ). + panel = page->panel( expandable = abap_false expanded = abap_true @@ -1575,4 +1583,4 @@ client->view_display( page->stringify( ) ). ENDMETHOD. - ENDCLASS. +ENDCLASS. diff --git a/src/z2ui5_cl_demo_app_206.clas.abap b/src/z2ui5_cl_demo_app_206.clas.abap index 68ceadf3..ddb1cc3f 100644 --- a/src/z2ui5_cl_demo_app_206.clas.abap +++ b/src/z2ui5_cl_demo_app_206.clas.abap @@ -56,7 +56,7 @@ CLASS z2ui5_cl_demo_app_206 IMPLEMENTATION. `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ` && `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat` ) . - layout->text( wrapping = abap_false text = `Lorem ipsum dolor st amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ` && + layout->text( wrapping = abap_false text = `No wrapping ... Lorem ipsum dolor st amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ` && `At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ` && `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ` && `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat` ) . diff --git a/src/z2ui5_cl_demo_app_207.clas.abap b/src/z2ui5_cl_demo_app_207.clas.abap new file mode 100644 index 00000000..b008e8eb --- /dev/null +++ b/src/z2ui5_cl_demo_app_207.clas.abap @@ -0,0 +1,94 @@ +class Z2UI5_CL_DEMO_APP_207 definition + public + create public . + +public section. + + interfaces IF_SERIALIZABLE_OBJECT . + interfaces Z2UI5_IF_APP . + + data CHECK_INITIALIZED type ABAP_BOOL . + PROTECTED SECTION. + + METHODS display_view + IMPORTING + client TYPE REF TO z2ui5_if_client. + METHODS on_event + IMPORTING + client TYPE REF TO z2ui5_if_client. + + PRIVATE SECTION. +ENDCLASS. + + + +CLASS Z2UI5_CL_DEMO_APP_207 IMPLEMENTATION. + + + METHOD DISPLAY_VIEW. + + DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( + )->page( + title = `abap2UI5 - Sample: Radio Button` + navbuttonpress = client->_event( 'BACK' ) + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ). + + DATA(layout) = page->vbox( class = `sapUiSmallMargin` + )->label( text = `Default RadioButton use` labelfor = `GroupA` + )->radio_button_group( id = `GroupA` + )->radio_button( text = `Option 1` selected = abap_true )->get_parent( + )->radio_button( text = `Option 2` )->get_parent( + )->radio_button( text = `Option 3` )->get_parent( + )->radio_button( text = `Option 4` )->get_parent( + )->radio_button( text = `Option 5` )->get_parent( )->get_parent( )->get_parent( + )->vbox( class = `sapUiSmallMargin` + )->label( text = `RadioButton in various ValueState variants` + )->hbox( class = `sapUiTinyMarginTopBottom` + )->vbox( class = `sapUiMediumMarginEnd` + )->label( text = `Success` labelfor = `GroupB` + )->radio_button_group( id = `GroupB` valueState = `Success` + )->radio_button( text = `Option 1` selected = abap_true )->get_parent( + )->radio_button( text = `Option 2` )->get_parent( )->get_parent( )->get_parent( + )->vbox( class = `sapUiMediumMarginEnd` + )->label( text = `Error` labelfor = `GroupC` + )->radio_button_group( id = `GroupC` valueState = `Error` + )->radio_button( text = `Option 1` selected = abap_true )->get_parent( + )->radio_button( text = `Option 2` )->get_parent( )->get_parent( )->get_parent( + )->vbox( class = `sapUiMediumMarginEnd` + )->label( text = `Warning` labelfor = `GroupD` + )->radio_button_group( id = `GroupD` valueState = `Warning` + )->radio_button( text = `Option 1` selected = abap_true )->get_parent( + )->radio_button( text = `Option 2` )->get_parent( )->get_parent( )->get_parent( + )->vbox( class = `sapUiMediumMarginEnd` + )->label( text = `Information` labelfor = `GroupE` + )->radio_button_group( id = `GroupE` valueState = `Information` + )->radio_button( text = `Option 1` selected = abap_true )->get_parent( + )->radio_button( text = `Option 2` )->get_parent( + ). + + client->view_display( page->stringify( ) ). + + ENDMETHOD. + + + METHOD ON_EVENT. + + CASE client->get( )-event. + WHEN 'BACK'. + client->nav_app_leave( ). + ENDCASE. + + ENDMETHOD. + + + METHOD Z2UI5_IF_APP~MAIN. + + IF check_initialized = abap_false. + check_initialized = abap_true. + display_view( client ). + ENDIF. + + on_event( client ). + + ENDMETHOD. +ENDCLASS. diff --git a/src/z2ui5_cl_demo_app_207.clas.xml b/src/z2ui5_cl_demo_app_207.clas.xml new file mode 100644 index 00000000..fc909719 --- /dev/null +++ b/src/z2ui5_cl_demo_app_207.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_DEMO_APP_207 + E + Radio Button + 1 + X + X + X + + + + From 30d2ab0548376e26e73ec6977c55fcc48d021252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Sat, 29 Jun 2024 12:32:56 -0600 Subject: [PATCH 21/29] New "Radio Button Group" Demo (#240) --- src/z2ui5_cl_demo_app_000.clas.abap | 7 +++ src/z2ui5_cl_demo_app_208.clas.abap | 86 +++++++++++++++++++++++++++++ src/z2ui5_cl_demo_app_208.clas.xml | 16 ++++++ 3 files changed, 109 insertions(+) create mode 100644 src/z2ui5_cl_demo_app_208.clas.abap create mode 100644 src/z2ui5_cl_demo_app_208.clas.xml diff --git a/src/z2ui5_cl_demo_app_000.clas.abap b/src/z2ui5_cl_demo_app_000.clas.abap index da9bb518..6eddfda9 100644 --- a/src/z2ui5_cl_demo_app_000.clas.abap +++ b/src/z2ui5_cl_demo_app_000.clas.abap @@ -356,6 +356,13 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION. class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' ). + panel->generic_tile( + header = 'Radio Button Group' + press = client->_event( 'Z2UI5_CL_DEMO_APP_208' ) + mode = 'LineMode' + class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' + ). + panel = page->panel( expandable = abap_false expanded = abap_true diff --git a/src/z2ui5_cl_demo_app_208.clas.abap b/src/z2ui5_cl_demo_app_208.clas.abap new file mode 100644 index 00000000..378f537f --- /dev/null +++ b/src/z2ui5_cl_demo_app_208.clas.abap @@ -0,0 +1,86 @@ +class Z2UI5_CL_DEMO_APP_208 definition + public + create public . + +public section. + + interfaces IF_SERIALIZABLE_OBJECT . + interfaces Z2UI5_IF_APP . + + data CHECK_INITIALIZED type ABAP_BOOL . + PROTECTED SECTION. + + METHODS display_view + IMPORTING + client TYPE REF TO z2ui5_if_client. + METHODS on_event + IMPORTING + client TYPE REF TO z2ui5_if_client. + + PRIVATE SECTION. +ENDCLASS. + + + +CLASS Z2UI5_CL_DEMO_APP_208 IMPLEMENTATION. + + + METHOD DISPLAY_VIEW. + + DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( + )->page( + title = `abap2UI5 - Sample: Radio Button Group` + navbuttonpress = client->_event( 'BACK' ) + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ). + + DATA(layout) = page->vbox( class = `sapUiSmallMargin` + )->label( labelfor = `rbg1` text = `An example with 'matrix' layout` + )->radio_button_group( id = `rbg1` columns = `3` width = `100%` class = `sapUiMediumMarginBottom` + )->radio_button( id = `RB1-1` text = `Long Option Number 1` )->get_parent( + )->radio_button( id = `RB1-2` text = `Option 2` enabled = abap_false )->get_parent( + )->radio_button( id = `RB1-3` text = `Nr. 3` editable = abap_false )->get_parent( + )->radio_button( id = `RB1-4` text = `Long Option 4` )->get_parent( + )->radio_button( id = `RB1-5` text = `Option 5` )->get_parent( + )->radio_button( id = `RB1-6` text = `Nr. 6` )->get_parent( )->get_parent( + )->label( labelfor = `rbg2` text = `An example with 3 buttons and 2 columns` + )->radio_button_group( id = `rbg2` columns = `2` selectedindex = `2` class = `sapUiMediumMarginBottom` + )->radio_button( id = `RB2-1` text = `Option 1` )->get_parent( + )->radio_button( id = `RB2-2` text = `Option 2` editable = abap_false )->get_parent( + )->radio_button( id = `RB2-3` text = `Option 3` )->get_parent( )->get_parent( + )->label( labelfor = `rbg3` text = `If the number of columns is equal to or exceeds the number of radio buttons they align horizontally` + )->radio_button_group( id = `rbg3` columns = `5` valuestate = `Error` class = `sapUiMediumMarginBottom` + )->radio_button( id = `RB3-1` text = `Option 1` )->get_parent( + )->radio_button( id = `RB3-2` text = `Option 2` )->get_parent( + )->radio_button( id = `RB3-3` text = `Option 3` )->get_parent( )->get_parent( + )->label( labelfor = `rbg4` text = `An example of a group in warning state` + )->radio_button_group( id = `rbg4` valuestate = `Warning` + )->radio_button( id = `RB4-1` text = `Option 1` )->get_parent( + )->radio_button( id = `RB4-2` text = `Option 2` )->get_parent( + ). + + client->view_display( page->stringify( ) ). + + ENDMETHOD. + + + METHOD ON_EVENT. + + CASE client->get( )-event. + WHEN 'BACK'. + client->nav_app_leave( ). + ENDCASE. + + ENDMETHOD. + + + METHOD Z2UI5_IF_APP~MAIN. + + IF check_initialized = abap_false. + check_initialized = abap_true. + display_view( client ). + ENDIF. + + on_event( client ). + + ENDMETHOD. +ENDCLASS. diff --git a/src/z2ui5_cl_demo_app_208.clas.xml b/src/z2ui5_cl_demo_app_208.clas.xml new file mode 100644 index 00000000..1989fa9b --- /dev/null +++ b/src/z2ui5_cl_demo_app_208.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_DEMO_APP_208 + E + Radio Button Group + 1 + X + X + X + + + + From 8b7360c96b2dbe87106d92eca9913b054d8c7de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Mon, 1 Jul 2024 01:50:07 -0600 Subject: [PATCH 22/29] New Demo: InfoLabel (#241) * Commit * Demo InfoLabel (2) * Demo: InfoLabel (3) --- src/z2ui5_cl_demo_app_000.clas.abap | 7 ++ src/z2ui5_cl_demo_app_209.clas.abap | 109 ++++++++++++++++++++++++++++ src/z2ui5_cl_demo_app_209.clas.xml | 16 ++++ 3 files changed, 132 insertions(+) create mode 100644 src/z2ui5_cl_demo_app_209.clas.abap create mode 100644 src/z2ui5_cl_demo_app_209.clas.xml diff --git a/src/z2ui5_cl_demo_app_000.clas.abap b/src/z2ui5_cl_demo_app_000.clas.abap index 6eddfda9..10bce9f0 100644 --- a/src/z2ui5_cl_demo_app_000.clas.abap +++ b/src/z2ui5_cl_demo_app_000.clas.abap @@ -299,6 +299,13 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION. class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' ). + panel->generic_tile( + header = 'InfoLabel' + press = client->_event( 'Z2UI5_CL_DEMO_APP_209' ) + mode = 'LineMode' + class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' + ). + panel = page->panel( expandable = abap_false expanded = abap_true diff --git a/src/z2ui5_cl_demo_app_209.clas.abap b/src/z2ui5_cl_demo_app_209.clas.abap new file mode 100644 index 00000000..55fe2cca --- /dev/null +++ b/src/z2ui5_cl_demo_app_209.clas.abap @@ -0,0 +1,109 @@ +class Z2UI5_CL_DEMO_APP_209 definition + public + create public . + +public section. + + interfaces IF_SERIALIZABLE_OBJECT . + interfaces Z2UI5_IF_APP . + + data: + BEGIN OF screen, + input1 TYPE string, + input2 TYPE string, + input3 TYPE string, + END OF screen . + data CHECK_INITIALIZED type ABAP_BOOL . + PROTECTED SECTION. + + METHODS display_view + IMPORTING + client TYPE REF TO z2ui5_if_client. + METHODS on_event + IMPORTING + client TYPE REF TO z2ui5_if_client. + + PRIVATE SECTION. +ENDCLASS. + + + +CLASS Z2UI5_CL_DEMO_APP_209 IMPLEMENTATION. + + + METHOD DISPLAY_VIEW. + + DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( + )->page( + title = 'abap2UI5 - Sample: InfoLabel' + navbuttonpress = client->_event( 'BACK' ) + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ). + + DATA(layout) = page->scroll_container( vertical = abap_true height = `100%` + )->flex_box( direction = `Column` alignitems = `Start` class = `sapUiMediumMargin` + )->flex_box( direction = `Row` alignitems = `Start` class = `sapUiTinyMarginBottom` + )->text( text = `Color Scheme 1` class = `sapUiTinyMarginEnd` + )->info_label( id = `il1` text = `2` rendermode = `Narrow` colorscheme = `1` )->get_parent( )->get_parent( + + )->flex_box( direction = `Row` alignitems = `Start` class = `sapUiTinyMarginBottom` + )->text( text = `Color Scheme 2` class = `sapUiTinyMarginEnd` + )->info_label( id = `il2` text = `5` rendermode = `Narrow` colorscheme = `2` )->get_parent( )->get_parent( + + )->flex_box( direction = `Row` alignitems = `Start` class = `sapUiTinyMarginBottom` + )->text( text = `Color Scheme 3` class = `sapUiTinyMarginEnd` + )->info_label( id = `il3` text = `12.5` rendermode = `Narrow` colorscheme = `3` )->get_parent( )->get_parent( + + )->flex_box( direction = `Row` alignitems = `Start` class = `sapUiTinyMarginBottom` + )->text( text = `Color Scheme 4` class = `sapUiTinyMarginEnd` + )->info_label( id = `il4` text = `2K` rendermode = `Narrow` colorscheme = `4` )->get_parent( )->get_parent( + + )->flex_box( direction = `Row` alignitems = `Start` class = `sapUiTinyMarginBottom` + )->text( text = `Color Scheme 5` class = `sapUiTinyMarginEnd` + )->info_label( id = `il5` text = `text info label` rendermode = `Loose` colorscheme = `5` )->get_parent( )->get_parent( + + )->flex_box( direction = `Row` alignitems = `Start` class = `sapUiTinyMarginBottom` + )->text( text = `Color Scheme 6` class = `sapUiTinyMarginEnd` + )->info_label( id = `il6` text = `just a long info label` colorscheme = `6` width = `140px` )->get_parent( )->get_parent( + + )->flex_box( direction = `Row` alignitems = `Start` class = `sapUiTinyMarginBottom` + )->text( text = `Color Scheme 7` class = `sapUiTinyMarginEnd` + )->info_label( id = `il7` text = `label shorter than width` colorscheme = `7` width = `250px` )->get_parent( )->get_parent( + + )->flex_box( direction = `Row` alignitems = `Start` class = `sapUiTinyMarginBottom` + )->text( text = `Color Scheme 8` class = `sapUiTinyMarginEnd` + )->info_label( id = `il8` text = `with icon` colorscheme = `8` icon = `sap-icon://home-share` )->get_parent( )->get_parent( + + )->flex_box( direction = `Row` alignitems = `Start` class = `sapUiTinyMarginBottom` + )->text( text = `Color Scheme 9` class = `sapUiTinyMarginEnd` + )->info_label( id = `il9` text = `in warehouse` colorscheme = `9` )->get_parent( )->get_parent( + + )->flex_box( direction = `Row` alignitems = `Start` class = `sapUiTinyMarginBottom` + )->text( text = `Any Color Scheme in Display Only Mode` class = `sapUiTinyMarginEnd` + )->info_label( id = `il10` text = `display only in form` colorscheme = `1` displayonly = abap_true ). + + client->view_display( page->stringify( ) ). + + ENDMETHOD. + + + METHOD ON_EVENT. + + CASE client->get( )-event. + WHEN 'BACK'. + client->nav_app_leave( ). + ENDCASE. + + ENDMETHOD. + + + METHOD Z2UI5_IF_APP~MAIN. + + IF check_initialized = abap_false. + check_initialized = abap_true. + display_view( client ). + ENDIF. + + on_event( client ). + + ENDMETHOD. +ENDCLASS. diff --git a/src/z2ui5_cl_demo_app_209.clas.xml b/src/z2ui5_cl_demo_app_209.clas.xml new file mode 100644 index 00000000..1406b1da --- /dev/null +++ b/src/z2ui5_cl_demo_app_209.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_DEMO_APP_209 + E + InfoLabel + 1 + X + X + X + + + + From 575942aaab05c9accee5b5c3a34b974fd07e5fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:26:20 -0600 Subject: [PATCH 23/29] New Demo: Input Types (#242) * New Demo: Input Types * New Demo: Input Types (2) --- src/z2ui5_cl_demo_app_000.clas.abap | 8 +++ src/z2ui5_cl_demo_app_210.clas.abap | 92 +++++++++++++++++++++++++++++ src/z2ui5_cl_demo_app_210.clas.xml | 16 +++++ 3 files changed, 116 insertions(+) create mode 100644 src/z2ui5_cl_demo_app_210.clas.abap create mode 100644 src/z2ui5_cl_demo_app_210.clas.xml diff --git a/src/z2ui5_cl_demo_app_000.clas.abap b/src/z2ui5_cl_demo_app_000.clas.abap index 10bce9f0..0e81b2aa 100644 --- a/src/z2ui5_cl_demo_app_000.clas.abap +++ b/src/z2ui5_cl_demo_app_000.clas.abap @@ -370,6 +370,14 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION. class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' ). + panel->generic_tile( + header = 'Input' + subheader = 'Types' + press = client->_event( 'Z2UI5_CL_DEMO_APP_210' ) + mode = 'LineMode' + class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' + ). + panel = page->panel( expandable = abap_false expanded = abap_true diff --git a/src/z2ui5_cl_demo_app_210.clas.abap b/src/z2ui5_cl_demo_app_210.clas.abap new file mode 100644 index 00000000..306e9b59 --- /dev/null +++ b/src/z2ui5_cl_demo_app_210.clas.abap @@ -0,0 +1,92 @@ +class Z2UI5_CL_DEMO_APP_210 definition + public + create public . + +public section. + + interfaces IF_SERIALIZABLE_OBJECT . + interfaces Z2UI5_IF_APP . + + data CHECK_INITIALIZED type ABAP_BOOL . + PROTECTED SECTION. + + METHODS display_view + IMPORTING + client TYPE REF TO z2ui5_if_client. + METHODS on_event + IMPORTING + client TYPE REF TO z2ui5_if_client. + + PRIVATE SECTION. +ENDCLASS. + + + +CLASS Z2UI5_CL_DEMO_APP_210 IMPLEMENTATION. + + + METHOD DISPLAY_VIEW. + + DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( + )->page( + title = 'abap2UI5 - Sample: Input - Types' + navbuttonpress = client->_event( 'BACK' ) + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ). + + DATA(layout) = page->vertical_layout( class = `sapUiContentPadding` width = `100%` ). + + layout->label( text = `Text` labelfor = `inputText` ). + layout->input( id = `inputText` + placeholder = `Enter text` + class = `sapUiSmallMarginBottom` ). + + layout->label( text = `Email` labelfor = `inputEmail` ). + layout->input( id = `inputEmail` + type = `Email` + placeholder = `Enter email` + class = `sapUiSmallMarginBottom` ). + + layout->label( text = `Telephone` labelfor = `inputTel` ). + layout->input( id = `inputTel` + type = `Tel` + placeholder = `Enter telephone number` + class = `sapUiSmallMarginBottom` ). + + layout->label( text = `Number` labelfor = `inputNumber` ). + layout->input( id = `inputNumber` + type = `Number` + placeholder = `Enter a number` + class = `sapUiSmallMarginBottom` ). + + layout->label( text = `URL` labelfor = `inputUrl` ). + layout->input( id = `inputUrl` + type = `Url` + placeholder = `Enter URL` + class = `sapUiSmallMarginBottom` ). + + client->view_display( page->stringify( ) ). + + ENDMETHOD. + + + METHOD ON_EVENT. + + CASE client->get( )-event. + WHEN 'BACK'. + client->nav_app_leave( ). + ENDCASE. + + ENDMETHOD. + + + METHOD Z2UI5_IF_APP~MAIN. + + IF check_initialized = abap_false. + check_initialized = abap_true. + display_view( client ). + ENDIF. + + on_event( client ). + + ENDMETHOD. +ENDCLASS. diff --git a/src/z2ui5_cl_demo_app_210.clas.xml b/src/z2ui5_cl_demo_app_210.clas.xml new file mode 100644 index 00000000..d917e8b0 --- /dev/null +++ b/src/z2ui5_cl_demo_app_210.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_DEMO_APP_210 + E + Input - Types + 1 + X + X + X + + + + From 100ed19d8eed83d0519babd37ee874ff0be9dbd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:28:43 -0600 Subject: [PATCH 24/29] Removing unnecessary code (#243) Co-authored-by: oblomov <102328295+oblomov-dev@users.noreply.github.com> --- src/z2ui5_cl_demo_app_209.clas.abap | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/z2ui5_cl_demo_app_209.clas.abap b/src/z2ui5_cl_demo_app_209.clas.abap index 55fe2cca..98ff30b5 100644 --- a/src/z2ui5_cl_demo_app_209.clas.abap +++ b/src/z2ui5_cl_demo_app_209.clas.abap @@ -7,12 +7,6 @@ public section. interfaces IF_SERIALIZABLE_OBJECT . interfaces Z2UI5_IF_APP . - data: - BEGIN OF screen, - input1 TYPE string, - input2 TYPE string, - input3 TYPE string, - END OF screen . data CHECK_INITIALIZED type ABAP_BOOL . PROTECTED SECTION. From 4afe40d36b99eb2a6d900792e84e8bde5ddc4128 Mon Sep 17 00:00:00 2001 From: abapsheep <135960093+abapsheep@users.noreply.github.com> Date: Tue, 2 Jul 2024 17:42:08 +0200 Subject: [PATCH 25/29] Sample with Issue (#244) * Sample with Issue * Update src/z2ui5_cl_demo_app_211.clas.abap Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> * Update Issue * Update Issue --------- Co-authored-by: Viktor Hoffmann Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> --- src/z2ui5_cl_demo_app_211.clas.abap | 187 +++++++++++++ src/z2ui5_cl_demo_app_211.clas.xml | 16 ++ src/z2ui5_cl_demo_app_212.clas.abap | 403 ++++++++++++++++++++++++++++ src/z2ui5_cl_demo_app_212.clas.xml | 16 ++ 4 files changed, 622 insertions(+) create mode 100644 src/z2ui5_cl_demo_app_211.clas.abap create mode 100644 src/z2ui5_cl_demo_app_211.clas.xml create mode 100644 src/z2ui5_cl_demo_app_212.clas.abap create mode 100644 src/z2ui5_cl_demo_app_212.clas.xml diff --git a/src/z2ui5_cl_demo_app_211.clas.abap b/src/z2ui5_cl_demo_app_211.clas.abap new file mode 100644 index 00000000..8868f7d6 --- /dev/null +++ b/src/z2ui5_cl_demo_app_211.clas.abap @@ -0,0 +1,187 @@ +"! +CLASS z2ui5_cl_demo_app_211 DEFINITION + PUBLIC + CREATE PUBLIC. + + PUBLIC SECTION. + INTERFACES if_serializable_object. + INTERFACES z2ui5_if_app. + + TYPES: + BEGIN OF ty_s_t002, + id TYPE string, + icon TYPE string, + count TYPE string, + table TYPE string, + descr TYPE string, + class TYPE string, + END OF ty_s_t002. + TYPES ty_t_t002 TYPE STANDARD TABLE OF ty_s_t002 WITH DEFAULT KEY. + + DATA mv_selectedkey TYPE string. + DATA mv_selectedkey_tmp TYPE string. + DATA mt_t002 TYPE ty_t_t002. + DATA mo_app TYPE REF TO object. + + PROTECTED SECTION. + DATA mo_main_page TYPE REF TO z2ui5_cl_xml_view. + + DATA client TYPE REF TO z2ui5_if_client. + DATA check_initialized TYPE abap_bool. + + METHODS on_init. + METHODS on_event. + METHODS render_Main. + + + + METHODS Render_sub_app. + + PRIVATE SECTION. + +ENDCLASS. + + +CLASS z2ui5_cl_demo_app_211 IMPLEMENTATION. + + + METHOD on_event. + CASE client->get( )-event. + WHEN 'ONSELECTICONTABBAR'. + + CASE mv_selectedkey. + + WHEN space. + + WHEN OTHERS. + + ENDCASE. + + WHEN 'BACK'. + + ENDCASE. + ENDMETHOD. + + METHOD on_init. + + mt_t002 = VALUE #( class = 'Z2UI5_CL_DEMO_APP_212' + ( id = '1' count = '5' table = 'Z2UI5_T003' descr = 'Table 01' icon = 'sap-icon://add' ) + ( id = '2' count = '10' table = 'Z2UI5_T003' descr = 'Table 01' icon = 'sap-icon://add' ) + ( id = '3' count = '15' table = 'Z2UI5_T004' descr = 'Table 02' icon = 'sap-icon://accept' ) ). + + mv_selectedkey = '1'. + + ENDMETHOD. + + METHOD render_main. + DATA(view) = z2ui5_cl_xml_view=>factory( )->shell( ). + + DATA(page) = view->page( id = `page_main` + title = 'Customizing' + navbuttonpress = client->_event( 'BACK' ) + shownavbutton = abap_true + class = 'sapUiContentPadding' ). + + DATA(lo_items) = page->icon_tab_bar( class = 'sapUiResponsiveContentPadding' + selectedKey = client->_bind_edit( mv_selectedkey ) + select = client->_event( val = 'ONSELECTICONTABBAR' ) + )->items( ). + + LOOP AT mt_t002 REFERENCE INTO DATA(line). + + DATA(text) = line->descr. + DATA(with_icon) = line->icon. + + lo_items->icon_tab_filter( icon = line->icon + iconcolor = 'Positive' + count = line->count + text = text + key = line->id + showall = with_icon ). + + lo_items->icon_tab_separator( ). + + ENDLOOP. + + mo_main_page = lo_items. + ENDMETHOD. + + METHOD z2ui5_if_app~main. + me->client = client. + + IF check_initialized = abap_false. + check_initialized = abap_true. + + on_init( ). + + render_Main( ). + + ENDIF. + + on_event( ). + + Render_sub_app( ). + ENDMETHOD. + + METHOD Render_sub_app. + + READ TABLE mt_t002 REFERENCE INTO DATA(t002) + WITH KEY id = mv_selectedkey. + + IF sy-subrc <> 0. + RETURN. + ENDIF. + + CASE mv_selectedkey. + + WHEN OTHERS. + + IF mv_selectedkey <> mv_selectedkey_tmp. + CREATE OBJECT mo_app TYPE (t002->class). + ENDIF. + + TRY. + + CALL METHOD mo_app->('SET_APP_DATA') + EXPORTING table = t002->table. + + render_Main( ). + + ASSIGN mo_app->('MO_PARENT_VIEW') TO FIELD-SYMBOL(). + IF IS ASSIGNED. + = mo_main_page. + ENDIF. + + CALL METHOD mo_app->('Z2UI5_IF_APP~MAIN') + EXPORTING client = client. + + CATCH cx_root. + RETURN. + ENDTRY. + + ENDCASE. + + ASSIGN mo_app->('MV_VIEW_DISPLAY') TO FIELD-SYMBOL(). + + IF = abap_true. + = abap_false. + client->view_display( mo_main_page->stringify( ) ). + ENDIF. + + ASSIGN mo_app->('MV_VIEW_MODEL_UPDATE') TO FIELD-SYMBOL(). + + IF = abap_true. + = abap_false. + client->view_model_update( ). + ENDIF. + + IF mv_selectedkey <> mv_selectedkey_tmp. + + client->view_display( mo_main_page->stringify( ) ). + + mv_selectedkey_tmp = mv_selectedkey. + + ENDIF. + ENDMETHOD. + +ENDCLASS. diff --git a/src/z2ui5_cl_demo_app_211.clas.xml b/src/z2ui5_cl_demo_app_211.clas.xml new file mode 100644 index 00000000..a3d49239 --- /dev/null +++ b/src/z2ui5_cl_demo_app_211.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_DEMO_APP_211 + E + App in App I + 1 + X + X + X + + + + diff --git a/src/z2ui5_cl_demo_app_212.clas.abap b/src/z2ui5_cl_demo_app_212.clas.abap new file mode 100644 index 00000000..901140ec --- /dev/null +++ b/src/z2ui5_cl_demo_app_212.clas.abap @@ -0,0 +1,403 @@ +CLASS z2ui5_cl_demo_app_212 DEFINITION + PUBLIC + CREATE PUBLIC. + + PUBLIC SECTION. + INTERFACES z2ui5_if_app. + + DATA mv_view_display TYPE abap_bool. + DATA mv_view_model_update TYPE abap_bool. + DATA mo_parent_view TYPE REF TO z2ui5_cl_xml_view. + DATA mv_table TYPE string. + DATA mt_table TYPE REF TO data. + DATA mt_table_tmp TYPE REF TO data. + DATA ms_table_row TYPE REF TO data. + DATA mt_comp TYPE abap_component_tab. + DATA ms_layout TYPE z2ui5_cl_pop_layout_v2=>ty_s_layout. + DATA mt_dfies TYPE z2ui5_cl_stmpncfctn_api=>ty_t_dfies. + + METHODS set_app_data + IMPORTING + !table TYPE string. + + PROTECTED SECTION. + DATA client TYPE REF TO z2ui5_if_client. + DATA check_initialized TYPE abap_bool. + + METHODS on_init. + + METHODS on_event. + + METHODS render_main. + + METHODS get_data. + + METHODS get_comp + RETURNING + VALUE(result) TYPE abap_component_tab. + + METHODS init_layout. + + METHODS on_after_navigation. + + METHODS row_select. + + METHODS prefill_popup_values + IMPORTING + !index TYPE string. + + METHODS render_popup. + + PRIVATE SECTION. + METHODS get_dfies. + +ENDCLASS. + + +CLASS z2ui5_cl_demo_app_212 IMPLEMENTATION. + + METHOD on_event. + + CASE client->get( )-event. + + WHEN 'BACK'. + client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ). + + WHEN 'ROW_SELECT'. + + row_select( ). + + WHEN OTHERS. + + client = z2ui5_cl_pop_layout_v2=>on_event_layout( client = client + layout = ms_layout ). + + ENDCASE. + ENDMETHOD. + + METHOD row_select. + + DATA(lt_arg) = client->get( )-t_event_arg. + READ TABLE lt_arg INTO DATA(ls_arg) INDEX 1. + + IF sy-subrc <> 0. + RETURN. + ENDIF. + + prefill_popup_values( ls_arg ). + + render_popup( ). + ENDMETHOD. + + METHOD prefill_popup_values. + + FIELD-SYMBOLS TYPE STANDARD TABLE. + FIELD-SYMBOLS TYPE any. + + ASSIGN mt_table->* TO . + + ASSIGN [ index ] TO FIELD-SYMBOL(). + + IF sy-subrc <> 0. + RETURN. + ENDIF. + + LOOP AT mt_dfies INTO DATA(dfies). + + ASSIGN COMPONENT dfies-fieldname OF STRUCTURE TO FIELD-SYMBOL(). + ASSIGN ms_table_row->* TO . + ASSIGN COMPONENT dfies-fieldname OF STRUCTURE TO FIELD-SYMBOL(). + + IF IS ASSIGNED AND IS ASSIGNED. + = . + ENDIF. + + ENDLOOP. + ENDMETHOD. + + METHOD get_dfies. + + mt_dfies = z2ui5_cl_util_api=>rtti_get_t_dfies_by_table_name( mv_table ). + + ENDMETHOD. + + METHOD render_popup. + + FIELD-SYMBOLS TYPE any. + + DATA(popup) = z2ui5_cl_xml_view=>factory_popup( ). + + DATA(simple_form) = popup->dialog( contentwidth = '60%' + )->simple_form( layout = 'ResponsiveGridLayout' + editable = abap_true + )->content( ns = 'form' ). + + " Gehe über alle Comps wenn wir im Edit sind dann sind keyfelder nicht eingabebereit. + LOOP AT mt_dfies REFERENCE INTO DATA(dfies). + + ASSIGN ms_table_row->* TO . + ASSIGN COMPONENT dfies->fieldname OF STRUCTURE TO FIELD-SYMBOL(). + IF IS NOT ASSIGNED. + CONTINUE. + ENDIF. + + DATA(text) = ms_layout-t_layout[ fname = dfies->fieldname ]-tlabel. + + simple_form->label( design = COND #( WHEN dfies->keyflag = abap_true THEN 'Bold' ) + text = text ). + + simple_form->input( value = client->_bind_edit( ) + enabled = abap_false + showvaluehelp = abap_false ). + + ENDLOOP. + + client->popup_display( popup->stringify( ) ). + + ENDMETHOD. + + METHOD on_init. + get_data( ). + + get_dfies( ). + + init_layout( ). + + render_main( ). + ENDMETHOD. + + METHOD init_layout. + + IF ms_layout IS NOT INITIAL. + RETURN. + ENDIF. + + DATA(class) = cl_abap_classdescr=>get_class_name( me ). + SHIFT class LEFT DELETING LEADING '\CLASS='. + + ms_layout = z2ui5_cl_pop_layout_v2=>init_layout( control = z2ui5_cl_pop_layout_v2=>m_table + data = mt_table + handle01 = CONV #( class ) + handle02 = CONV #( mv_table ) + handle03 = '' + handle04 = '' ). + + ENDMETHOD. + + METHOD render_main. + + FIELD-SYMBOLS TYPE data. + + IF mo_parent_view IS INITIAL. + DATA(page) = z2ui5_cl_xml_view=>factory( ). + ELSE. + page = mo_parent_view->get( `Page` ). + ENDIF. + + ASSIGN mt_table->* TO . + + DATA(table) = page->table( growing = 'true' + width = 'auto' + items = client->_bind_edit( val = ) ). + + " TODO: variable is assigned but never used (ABAP cleaner) + DATA(headder) = table->header_toolbar( + )->overflow_toolbar( + )->toolbar_spacer( ). + + headder = z2ui5_cl_pop_layout_v2=>render_layout_function( xml = headder + client = client ). + + DATA(columns) = table->columns( ). + + LOOP AT ms_layout-t_layout REFERENCE INTO DATA(layout). + DATA(lv_index) = sy-tabix. + + columns->column( visible = client->_bind( val = layout->visible + tab = ms_layout-t_layout + tab_index = lv_index ) + halign = client->_bind( val = layout->halign + tab = ms_layout-t_layout + tab_index = lv_index ) + importance = client->_bind( val = layout->importance + tab = ms_layout-t_layout + tab_index = lv_index ) + mergeduplicates = client->_bind( val = layout->merge + tab = ms_layout-t_layout + tab_index = lv_index ) + width = client->_bind( val = layout->width + tab = ms_layout-t_layout + tab_index = lv_index ) + + )->text( layout->tlabel ). + + ENDLOOP. + + DATA(cells) = columns->get_parent( )->items( + )->column_list_item( + valign = 'Middle' + type = 'Navigation' + press = client->_event( val = 'ROW_SELECT' + t_arg = VALUE #( ( `${ROW_ID}` ) ) ) + )->cells( ). + + " Subcolumns require new rendering.... + LOOP AT ms_layout-t_layout REFERENCE INTO layout. + + IF layout->t_sub_col IS NOT INITIAL. + + DATA(sub_col) = ``. + DATA(index) = 0. + LOOP AT layout->t_sub_col INTO DATA(subcol). + + index = index + 1. + + READ TABLE ms_layout-t_layout INTO DATA(line) WITH KEY fname = subcol-fname. + + IF index = 1. + sub_col = |{ line-tlabel }: \{{ subcol-fname }\}|. + ELSE. + sub_col = |{ sub_col }{ cl_abap_char_utilities=>cr_lf } { line-tlabel }: \{{ subcol-fname }\}|. + ENDIF. + + ENDLOOP. + + cells->object_identifier( title = |\{{ layout->fname }\}| + text = sub_col ). + + ELSE. + cells->object_identifier( text = |\{{ layout->fname }\}| ). + ENDIF. + ENDLOOP. + + IF mo_parent_view IS INITIAL. + + client->view_display( page->get_root( )->xml_get( ) ). + + ELSE. + + mv_view_display = abap_true. + + ENDIF. + + ENDMETHOD. + + METHOD z2ui5_if_app~main. + me->client = client. + + IF check_initialized = abap_false. + check_initialized = abap_true. + + on_init( ). + + ENDIF. + + on_event( ). + + on_after_navigation( ). + + ENDMETHOD. + + METHOD set_app_data. + + mv_table = table. + + ENDMETHOD. + + METHOD get_data. + + FIELD-SYMBOLS
TYPE STANDARD TABLE. + FIELD-SYMBOLS TYPE STANDARD TABLE. + + mt_comp = get_comp( ). + + TRY. + + DATA(new_struct_desc) = cl_abap_structdescr=>create( mt_comp ). + + DATA(new_table_desc) = cl_abap_tabledescr=>create( p_line_type = new_struct_desc + p_table_kind = cl_abap_tabledescr=>tablekind_std ). + + CREATE DATA mt_table TYPE HANDLE new_table_desc. + CREATE DATA mt_table_tmp TYPE HANDLE new_table_desc. + CREATE DATA ms_table_row TYPE HANDLE new_struct_desc. + + ASSIGN mt_table->* TO
. + + SELECT * + FROM (mv_table) + INTO CORRESPONDING FIELDS OF TABLE @
+ UP TO 100 ROWS. + + CATCH cx_root. + + ENDTRY. + + ASSIGN mt_table_tmp->* TO . + + =
. + + ENDMETHOD. + + METHOD get_comp. + + DATA index TYPE int4. + + TRY. + TRY. + + cl_abap_typedescr=>describe_by_name( EXPORTING p_name = mv_table + RECEIVING p_descr_ref = DATA(typedesc) + EXCEPTIONS type_not_found = 1 + OTHERS = 2 ). + + DATA(structdesc) = CAST cl_abap_structdescr( typedesc ). + DATA(comp) = structdesc->get_components( ). + + LOOP AT comp INTO DATA(com). + IF com-as_include = abap_false. + APPEND com TO result. + ENDIF. + ENDLOOP. + + CATCH cx_root. + + ENDTRY. + + DATA(component) = VALUE cl_abap_structdescr=>component_table( + ( name = 'ROW_ID' + type = CAST #( cl_abap_datadescr=>describe_by_data( index ) ) ) ). + + APPEND LINES OF component TO result. + + CATCH cx_root. + ENDTRY. + ENDMETHOD. + + METHOD on_after_navigation. + + IF client->get( )-check_on_navigated = abap_false. + RETURN. + ENDIF. + + TRY. + + DATA(app) = CAST z2ui5_cl_pop_layout_v2( client->get_app( client->get( )-s_draft-id_prev_app ) ). + + ms_layout = app->ms_layout. + + IF app->mv_rerender = abap_true. + " subcolumns need rerendering to work .. + render_main( ). + mv_view_display = abap_TRUE. + ELSE. + " for all other changes in Layout View Model Update is enough. + mv_view_model_update = abap_true. + + ENDIF. + CATCH cx_root. + ENDTRY. + + ENDMETHOD. + +ENDCLASS. diff --git a/src/z2ui5_cl_demo_app_212.clas.xml b/src/z2ui5_cl_demo_app_212.clas.xml new file mode 100644 index 00000000..325cd447 --- /dev/null +++ b/src/z2ui5_cl_demo_app_212.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_DEMO_APP_212 + E + App in App II + 1 + X + X + X + + + + From c158b36e4b463c3236883d5bdfe8abcf7a19509a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Tue, 2 Jul 2024 09:43:39 -0600 Subject: [PATCH 26/29] New Demo: Input Password (#245) * New Demo: Input - Password (1) * New Demo: Input - Password (2) --------- Co-authored-by: oblomov <102328295+oblomov-dev@users.noreply.github.com> --- src/z2ui5_cl_demo_app_000.clas.abap | 8 ++++ src/z2ui5_cl_demo_app_213.clas.abap | 66 +++++++++++++++++++++++++++++ src/z2ui5_cl_demo_app_213.clas.xml | 16 +++++++ 3 files changed, 90 insertions(+) create mode 100644 src/z2ui5_cl_demo_app_213.clas.abap create mode 100644 src/z2ui5_cl_demo_app_213.clas.xml diff --git a/src/z2ui5_cl_demo_app_000.clas.abap b/src/z2ui5_cl_demo_app_000.clas.abap index 0e81b2aa..930efc23 100644 --- a/src/z2ui5_cl_demo_app_000.clas.abap +++ b/src/z2ui5_cl_demo_app_000.clas.abap @@ -378,6 +378,14 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION. class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' ). + panel->generic_tile( + header = 'Input' + subheader = 'Password' + press = client->_event( 'Z2UI5_CL_DEMO_APP_213' ) + mode = 'LineMode' + class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' + ). + panel = page->panel( expandable = abap_false expanded = abap_true diff --git a/src/z2ui5_cl_demo_app_213.clas.abap b/src/z2ui5_cl_demo_app_213.clas.abap new file mode 100644 index 00000000..183f7b5e --- /dev/null +++ b/src/z2ui5_cl_demo_app_213.clas.abap @@ -0,0 +1,66 @@ +class Z2UI5_CL_DEMO_APP_213 definition + public + create public . + +public section. + + interfaces Z2UI5_IF_APP . + + data CHECK_INITIALIZED type ABAP_BOOL . + PROTECTED SECTION. + + METHODS display_view + IMPORTING + client TYPE REF TO z2ui5_if_client. + METHODS on_event + IMPORTING + client TYPE REF TO z2ui5_if_client. + + PRIVATE SECTION. +ENDCLASS. + + + +CLASS Z2UI5_CL_DEMO_APP_213 IMPLEMENTATION. + + + METHOD DISPLAY_VIEW. + + DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( + )->page( + title = 'abap2UI5 - Sample: Input - Password' + navbuttonpress = client->_event( 'BACK' ) + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ). + + DATA(layout) = page->vertical_layout( class = `sapUiContentPadding` width = `100%` ). + layout->label( text = `Password` labelfor = `passwordInput` ). + layout->input( id = `passwordInput` + type = `Password` + placeholder = `Enter password`). + + client->view_display( page->stringify( ) ). + + ENDMETHOD. + + + METHOD ON_EVENT. + + CASE client->get( )-event. + WHEN 'BACK'. + client->nav_app_leave( ). + ENDCASE. + + ENDMETHOD. + + + METHOD Z2UI5_IF_APP~MAIN. + + IF check_initialized = abap_false. + check_initialized = abap_true. + display_view( client ). + ENDIF. + + on_event( client ). + + ENDMETHOD. +ENDCLASS. diff --git a/src/z2ui5_cl_demo_app_213.clas.xml b/src/z2ui5_cl_demo_app_213.clas.xml new file mode 100644 index 00000000..8e6c4e20 --- /dev/null +++ b/src/z2ui5_cl_demo_app_213.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_DEMO_APP_213 + E + Input - Password + 1 + X + X + X + + + + From 44aacda55ae63de9f7581b18744a72dc0cb8daf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mil=C3=A1n?= <36721657+francisco-milan@users.noreply.github.com> Date: Wed, 3 Jul 2024 00:54:55 -0600 Subject: [PATCH 27/29] New Demo: Standalone Icon Tab Header (#246) --- src/z2ui5_cl_demo_app_000.clas.abap | 7 +++ src/z2ui5_cl_demo_app_214.clas.abap | 75 +++++++++++++++++++++++++++++ src/z2ui5_cl_demo_app_214.clas.xml | 16 ++++++ 3 files changed, 98 insertions(+) create mode 100644 src/z2ui5_cl_demo_app_214.clas.abap create mode 100644 src/z2ui5_cl_demo_app_214.clas.xml diff --git a/src/z2ui5_cl_demo_app_000.clas.abap b/src/z2ui5_cl_demo_app_000.clas.abap index 930efc23..59bcedf1 100644 --- a/src/z2ui5_cl_demo_app_000.clas.abap +++ b/src/z2ui5_cl_demo_app_000.clas.abap @@ -768,6 +768,13 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION. class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' ). + panel->generic_tile( + header = 'Icon Tab Header' + subheader = 'Standalone Icon Tab Header' + press = client->_event( 'Z2UI5_CL_DEMO_APP_214' ) + mode = 'LineMode' + class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' + ). panel = page->panel( expandable = abap_false diff --git a/src/z2ui5_cl_demo_app_214.clas.abap b/src/z2ui5_cl_demo_app_214.clas.abap new file mode 100644 index 00000000..27848d96 --- /dev/null +++ b/src/z2ui5_cl_demo_app_214.clas.abap @@ -0,0 +1,75 @@ +class z2ui5_cl_demo_app_214 definition + public + create public . + +public section. + + interfaces IF_SERIALIZABLE_OBJECT . + interfaces Z2UI5_IF_APP . + + data: + BEGIN OF screen, + input1 TYPE string, + input2 TYPE string, + input3 TYPE string, + END OF screen . + data CHECK_INITIALIZED type ABAP_BOOL . + PROTECTED SECTION. + + METHODS display_view + IMPORTING + client TYPE REF TO z2ui5_if_client. + METHODS on_event + IMPORTING + client TYPE REF TO z2ui5_if_client. + + PRIVATE SECTION. +ENDCLASS. + + + +CLASS z2ui5_cl_demo_app_214 IMPLEMENTATION. + + + METHOD DISPLAY_VIEW. + + DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( + )->page( + title = 'abap2UI5 - Sample: Standalone Icon Tab Header' + navbuttonpress = client->_event( 'BACK' ) + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ). + + DATA(layout) = page->icon_tab_header( mode = `Inline` + )->items( + )->icon_tab_filter( key = `info` text = `Info` )->get_parent( + )->icon_tab_filter( key = `attachments` text = `Attachments` count = `3` )->get_parent( + )->icon_tab_filter( key = `notes` text = `Notes` count = `12` )->get_parent( + )->icon_tab_filter( key = `people` text = `People` + ). + + client->view_display( page->stringify( ) ). + + ENDMETHOD. + + + METHOD ON_EVENT. + + CASE client->get( )-event. + WHEN 'BACK'. + client->nav_app_leave( ). + ENDCASE. + + ENDMETHOD. + + + METHOD Z2UI5_IF_APP~MAIN. + + IF check_initialized = abap_false. + check_initialized = abap_true. + display_view( client ). + ENDIF. + + on_event( client ). + + ENDMETHOD. +ENDCLASS. diff --git a/src/z2ui5_cl_demo_app_214.clas.xml b/src/z2ui5_cl_demo_app_214.clas.xml new file mode 100644 index 00000000..5fec27b0 --- /dev/null +++ b/src/z2ui5_cl_demo_app_214.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_DEMO_APP_214 + E + Input - Password + 1 + X + X + X + + + + From d3d87e5037c8ddeb19895851b7fa0b2eee022ad3 Mon Sep 17 00:00:00 2001 From: abapsheep <135960093+abapsheep@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:18:24 +0200 Subject: [PATCH 28/29] Update Issue (#247) * Update Issue * Update Issue --------- Co-authored-by: Viktor Hoffmann --- src/z2ui5_cl_demo_app_212.clas.abap | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/z2ui5_cl_demo_app_212.clas.abap b/src/z2ui5_cl_demo_app_212.clas.abap index 901140ec..055b0c79 100644 --- a/src/z2ui5_cl_demo_app_212.clas.abap +++ b/src/z2ui5_cl_demo_app_212.clas.abap @@ -127,7 +127,7 @@ CLASS z2ui5_cl_demo_app_212 IMPLEMENTATION. DATA(popup) = z2ui5_cl_xml_view=>factory_popup( ). - DATA(simple_form) = popup->dialog( contentwidth = '60%' + DATA(content) = popup->dialog( contentwidth = '60%' )->simple_form( layout = 'ResponsiveGridLayout' editable = abap_true )->content( ns = 'form' ). @@ -143,12 +143,11 @@ CLASS z2ui5_cl_demo_app_212 IMPLEMENTATION. DATA(text) = ms_layout-t_layout[ fname = dfies->fieldname ]-tlabel. - simple_form->label( design = COND #( WHEN dfies->keyflag = abap_true THEN 'Bold' ) - text = text ). + content->label( text = text ). - simple_form->input( value = client->_bind_edit( ) - enabled = abap_false - showvaluehelp = abap_false ). + content->input( value = client->_bind_edit( ) + enabled = abap_false + showvaluehelp = abap_false ). ENDLOOP. From 4a829746fd9413855adf7817103b4d32b07c4be7 Mon Sep 17 00:00:00 2001 From: abapsheep <135960093+abapsheep@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:49:12 +0200 Subject: [PATCH 29/29] Update Issue (#248) * Update Issue * Update Issue * Update Issue --------- Co-authored-by: Viktor Hoffmann --- src/z2ui5_cl_demo_app_211.clas.abap | 2 +- src/z2ui5_cl_demo_app_212.clas.abap | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/z2ui5_cl_demo_app_211.clas.abap b/src/z2ui5_cl_demo_app_211.clas.abap index 8868f7d6..f9abbe75 100644 --- a/src/z2ui5_cl_demo_app_211.clas.abap +++ b/src/z2ui5_cl_demo_app_211.clas.abap @@ -66,7 +66,7 @@ CLASS z2ui5_cl_demo_app_211 IMPLEMENTATION. mt_t002 = VALUE #( class = 'Z2UI5_CL_DEMO_APP_212' ( id = '1' count = '5' table = 'Z2UI5_T003' descr = 'Table 01' icon = 'sap-icon://add' ) - ( id = '2' count = '10' table = 'Z2UI5_T003' descr = 'Table 01' icon = 'sap-icon://add' ) +* ( id = '2' count = '10' table = 'Z2UI5_T003' descr = 'Table 01' icon = 'sap-icon://add' ) ( id = '3' count = '15' table = 'Z2UI5_T004' descr = 'Table 02' icon = 'sap-icon://accept' ) ). mv_selectedkey = '1'. diff --git a/src/z2ui5_cl_demo_app_212.clas.abap b/src/z2ui5_cl_demo_app_212.clas.abap index 055b0c79..ad3fe409 100644 --- a/src/z2ui5_cl_demo_app_212.clas.abap +++ b/src/z2ui5_cl_demo_app_212.clas.abap @@ -8,19 +8,19 @@ CLASS z2ui5_cl_demo_app_212 DEFINITION DATA mv_view_display TYPE abap_bool. DATA mv_view_model_update TYPE abap_bool. DATA mo_parent_view TYPE REF TO z2ui5_cl_xml_view. - DATA mv_table TYPE string. DATA mt_table TYPE REF TO data. DATA mt_table_tmp TYPE REF TO data. DATA ms_table_row TYPE REF TO data. - DATA mt_comp TYPE abap_component_tab. DATA ms_layout TYPE z2ui5_cl_pop_layout_v2=>ty_s_layout. - DATA mt_dfies TYPE z2ui5_cl_stmpncfctn_api=>ty_t_dfies. METHODS set_app_data IMPORTING !table TYPE string. PROTECTED SECTION. + DATA mv_table TYPE string. + DATA mt_comp TYPE abap_component_tab. + DATA mt_dfies TYPE z2ui5_cl_stmpncfctn_api=>ty_t_dfies. DATA client TYPE REF TO z2ui5_if_client. DATA check_initialized TYPE abap_bool.