diff --git a/README.md b/README.md index 7ab9c68b..e44d8e44 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,9 @@ Development of UI5 Apps in pure ABAP. Follow this project on [twitter](https://t * Featured in the SAP Developer News [(youtube - 26.01.2023)](https://www.youtube.com/watch?v=6BDK55xYttM) * Development of UI5 Selection-Screens in pure ABAP (former version) [(Blog SCN - 22.01.2023)](https://blogs.sap.com/2023/01/22/abap2ui5-project-development-of-ui5-selection-screens-in-pure-abap-no-app-deployment-or-javascript-needed/) -### Demo Application [(Source Code)](https://github.com/oblomov-dev/ABAP2UI5/blob/main/src/00/z2ui5_cl_app_demo_01.clas.abap) -![tweet1](https://user-images.githubusercontent.com/102328295/220315102-2e1e6545-ac32-4ea3-9d10-7286998304e7.gif) +### Demo [(Example)](https://github.com/oblomov-dev/ABAP2UI5/blob/main/src/00/z2ui5_cl_app_demo_01.clas.abap) +![gif_git](https://user-images.githubusercontent.com/102328295/227471575-617dad73-5c3a-4ed2-be31-fe537ca0c080.gif) + ## Installation Works with all available ABAP stacks and language versions: diff --git a/src/00/z2ui5_cl_app_demo_00.clas.abap b/src/00/z2ui5_cl_app_demo_00.clas.abap index fce4cc18..13a45b42 100644 --- a/src/00/z2ui5_cl_app_demo_00.clas.abap +++ b/src/00/z2ui5_cl_app_demo_00.clas.abap @@ -133,22 +133,21 @@ CLASS Z2UI5_CL_APP_DEMO_00 IMPLEMENTATION. growfactor = '3' styleclass = 'sapUiTinyMargin' ). - -* form->flex_box( class = 'columns' -* )->button( -* text = 'Visualization' -* press = client->_event( 'z2ui5_cl_app_demo_16' ) )->get( -* )->layout_data( -* )->flex_item_data( -* growfactor = '1' -* styleclass = 'sapUiTinyMargin' -* )->get_parent( )->get_parent( -* )->text( `Use the sap.suite.ui.microchart controls to visualize data - ` -* && 'choose between bar charts, donut charts, line charts or radial charts and make your boring data beautiful' )->get( -* )->layout_data( -* )->flex_item_data( -* growfactor = '3' -* styleclass = 'sapUiTinyMargin' ). + form->flex_box( class = 'columns' + )->button( + text = 'Visualization' + press = client->_event( 'z2ui5_cl_app_demo_16' ) )->get( + )->layout_data( + )->flex_item_data( + growfactor = '1' + styleclass = 'sapUiTinyMargin' + )->get_parent( )->get_parent( + )->text( `Use the sap.suite.ui.microchart controls to visualize data - ` + && 'choose between bar charts, donut charts, line charts or radial charts and make your data beautiful' )->get( + )->layout_data( + )->flex_item_data( + growfactor = '3' + styleclass = 'sapUiTinyMargin' ). ENDCASE. ENDMETHOD. diff --git a/src/00/z2ui5_cl_app_demo_03.clas.abap b/src/00/z2ui5_cl_app_demo_03.clas.abap index 3a927b6a..26bbc727 100644 --- a/src/00/z2ui5_cl_app_demo_03.clas.abap +++ b/src/00/z2ui5_cl_app_demo_03.clas.abap @@ -23,7 +23,7 @@ ENDCLASS. -CLASS Z2UI5_CL_APP_DEMO_03 IMPLEMENTATION. +CLASS z2ui5_cl_app_demo_03 IMPLEMENTATION. METHOD z2ui5_if_app~controller. @@ -36,12 +36,12 @@ CLASS Z2UI5_CL_APP_DEMO_03 IMPLEMENTATION. check_initialized = abap_true. t_tab = VALUE #( - ( title = 'Peter' info = 'completed' descr = 'this is a description' icon = 'sap-icon://account' ) - ( title = 'Peter' info = 'incompleted' descr = 'this is a description' icon = 'sap-icon://account' ) - ( title = 'Peter' info = 'working' descr = 'this is a description' icon = 'sap-icon://account' ) - ( title = 'Peter' info = 'working' descr = 'this is a description' icon = 'sap-icon://account' ) - ( title = 'Peter' info = 'completed' descr = 'this is a description' icon = 'sap-icon://account' ) - ( title = 'Peter' info = 'completed' descr = 'this is a description' icon = 'sap-icon://account' ) + ( title = 'Peter' info = 'completed' descr = 'this is a description' icon = 'sap-icon://account' ) + ( title = 'Peter' info = 'incompleted' descr = 'this is a description' icon = 'sap-icon://account' ) + ( title = 'Peter' info = 'working' descr = 'this is a description' icon = 'sap-icon://account' ) + ( title = 'Peter' info = 'working' descr = 'this is a description' icon = 'sap-icon://account' ) + ( title = 'Peter' info = 'completed' descr = 'this is a description' icon = 'sap-icon://account' ) + ( title = 'Peter' info = 'completed' descr = 'this is a description' icon = 'sap-icon://account' ) ). RETURN. @@ -67,7 +67,7 @@ CLASS Z2UI5_CL_APP_DEMO_03 IMPLEMENTATION. page->list( headertext = 'List Ouput' - items = client->_bind_one_way( t_tab ) + items = client->_bind_one_way( t_tab ) )->standard_list_item( title = '{TITLE}' description = '{DESCR}' diff --git a/src/00/z2ui5_cl_app_demo_06.clas.abap b/src/00/z2ui5_cl_app_demo_06.clas.abap index cfb316c2..2f191cbb 100644 --- a/src/00/z2ui5_cl_app_demo_06.clas.abap +++ b/src/00/z2ui5_cl_app_demo_06.clas.abap @@ -30,7 +30,6 @@ CLASS Z2UI5_CL_APP_DEMO_06 IMPLEMENTATION. CASE client->get( )-lifecycle_method. - WHEN client->cs-lifecycle_method-on_event. IF check_initialized = abap_false. @@ -44,7 +43,6 @@ CLASS Z2UI5_CL_APP_DEMO_06 IMPLEMENTATION. RETURN. ENDIF. - CASE client->get( )-event. WHEN 'BUTTON_SORT'. @@ -58,7 +56,6 @@ CLASS Z2UI5_CL_APP_DEMO_06 IMPLEMENTATION. ENDCASE. - WHEN client->cs-lifecycle_method-on_rendering. DATA(page) = client->factory_view( diff --git a/src/00/z2ui5_cl_app_demo_16.clas.abap b/src/00/z2ui5_cl_app_demo_16.clas.abap index d3d74297..3fbb1114 100644 --- a/src/00/z2ui5_cl_app_demo_16.clas.abap +++ b/src/00/z2ui5_cl_app_demo_16.clas.abap @@ -15,6 +15,16 @@ CLASS z2ui5_cl_app_demo_16 DEFINITION PUBLIC. DATA mv_sel2 TYPE abap_bool. DATA mv_sel3 TYPE abap_bool. + DATA mv_sel4 TYPE abap_bool. + DATA mv_sel5 TYPE abap_bool. + DATA mv_sel6 TYPE abap_bool. + DATA mv_sel7 TYPE abap_bool. + DATA mv_sel8 TYPE abap_bool. + DATA mv_sel9 TYPE abap_bool. + DATA mv_sel10 TYPE abap_bool. + DATA mv_sel11 TYPE abap_bool. + DATA mv_sel12 TYPE abap_bool. + DATA mv_tab_bar_active TYPE abap_bool. DATA mv_tab_donut_active TYPE abap_bool. DATA mv_tab_line_active TYPE abap_bool. @@ -47,6 +57,58 @@ ENDCLASS. CLASS z2ui5_cl_app_demo_16 IMPLEMENTATION. + METHOD z2ui5_if_app~controller. + + CASE client->get( )-lifecycle_method. + + WHEN client->cs-lifecycle_method-on_event. + + IF check_initialized = abap_false. + check_initialized = abap_true. + + mv_path = '../../demo/text'. + mv_type = 'plain_text'. + mv_sel1 = abap_true. + + RETURN. + ENDIF. + + CASE client->get( )-event. + + WHEN 'DONUT_CHANGED'. + client->popup_message_toast( 'Donut selection changed' ). + + WHEN 'BAR_CHANGED'. + client->popup_message_toast( 'Bar selection changed' ). + + WHEN 'LINE_CHANGED'. + client->popup_message_toast( 'Line selection changed' ). + + WHEN 'DONUT_CHANGED'. + client->popup_message_toast( 'Donut selection changed' ). + + WHEN 'BACK'. + client->nav_app_leave( client->get( )-id_prev_app_stack ). + + ENDCASE. + + WHEN client->cs-lifecycle_method-on_rendering. + + DATA(view) = client->factory_view( 'VIEW_INPUT' ). + DATA(page) = view->page( title = 'abap2UI5 - Visualization' navbuttonpress = client->_event( 'BACK' ) ). + page->header_content( + ")->link( text = 'Demo' href = `https://twitter.com/OblomovDev/status/1634206964291911682` + )->link( text = 'Source_Code' href = client->get( )-s_request-url_source_code ). + + DATA(container) = page->tab_container( ). + render_tab_donut( client = client container = container ). + render_tab_bar( client = client container = container ). + render_tab_line( client = client container = container ). + render_tab_radial( client = client container = container ). + + ENDCASE. + + ENDMETHOD. METHOD render_tab_bar. @@ -71,7 +133,7 @@ CLASS z2ui5_cl_app_demo_16 IMPLEMENTATION. class = 'sapUiSmallMargin' )->items( )->interact_bar_chart( selectionchanged = client->_event( 'BAR_CHANGED' ) - press = client->_event( 'BAR_PRESS' ) + press = client->_event( 'BAR_CHANGED' ) )->bars( ). bar->interact_bar_chart_bar( selected = client->_bind( mv_sel1 ) label = 'Product 1' value = '10' ). bar->interact_bar_chart_bar( selected = client->_bind( mv_sel2 ) label = 'Product 2' value = '20' ). @@ -84,11 +146,10 @@ CLASS z2ui5_cl_app_demo_16 IMPLEMENTATION. class = 'sapUiSmallMargin' )->items( )->interact_bar_chart( selectionchanged = client->_event( 'BAR_CHANGED' ) - press = client->_event( 'BAR_PRESS' ) )->bars( ). - bar->interact_bar_chart_bar( selected = client->_bind( mv_sel1 ) label = 'Product 1' value = '10' displayedvalue = '10%' ). - bar->interact_bar_chart_bar( selected = client->_bind( mv_sel2 ) label = 'Product 2' value = '20' displayedvalue = '20%' ). - bar->interact_bar_chart_bar( selected = client->_bind( mv_sel3 ) label = 'Product 3' value = '70' displayedvalue = '70%' ). + bar->interact_bar_chart_bar( label = 'Product 1' value = '10' displayedvalue = '10%' ). + bar->interact_bar_chart_bar( label = 'Product 2' value = '20' displayedvalue = '20%' ). + bar->interact_bar_chart_bar( label = 'Product 3' value = '70' displayedvalue = '70%' ). bar = grid->vertical_layout( )->layout_data( 'l' @@ -139,9 +200,9 @@ CLASS z2ui5_cl_app_demo_16 IMPLEMENTATION. )->interact_donut_chart( selectionchanged = client->_event( 'DONUT_CHANGED' ) )->segments( ). - seg->interact_donut_chart_segment( selected = client->_bind( mv_sel1 ) label = 'Impl. Phase' value = '40.0' displayedvalue = '40.0%' ). - seg->interact_donut_chart_segment( selected = client->_bind( mv_sel2 ) label = 'Design Phase' value = '21.5' displayedvalue = '21.5%' ). - seg->interact_donut_chart_segment( selected = client->_bind( mv_sel3 ) label = 'Test Phase' value = '38.5' displayedvalue = '38.5%' ). + seg->interact_donut_chart_segment( selected = client->_bind( mv_sel4 ) label = 'Impl. Phase' value = '40.0' displayedvalue = '40.0%' ). + seg->interact_donut_chart_segment( selected = client->_bind( mv_sel5 ) label = 'Design Phase' value = '21.5' displayedvalue = '21.5%' ). + seg->interact_donut_chart_segment( selected = client->_bind( mv_sel6 ) label = 'Test Phase' value = '38.5' displayedvalue = '38.5%' ). grid->text( text = 'Four segments' @@ -185,8 +246,6 @@ CLASS z2ui5_cl_app_demo_16 IMPLEMENTATION. seg->interact_donut_chart_segment( label = 'Design Phase' value = '21.5' displayedvalue = '21.5%' ). seg->interact_donut_chart_segment( label = 'Test Phase' value = '38.5' displayedvalue = '38.5%' ). - - ENDMETHOD. @@ -216,12 +275,12 @@ CLASS z2ui5_cl_app_demo_16 IMPLEMENTATION. precedingpoint = '15' succeddingpoint = '89' )->points( ). - point->interact_line_chart_point( label = 'May' value = '33.1' secondarylabel = 'Q2' ). - point->interact_line_chart_point( label = 'June' value = '12' ). - point->interact_line_chart_point( label = 'July' value = '51.4' secondarylabel = 'Q3' ). - point->interact_line_chart_point( label = 'Aug' value = '52' ). - point->interact_line_chart_point( label = 'Sep' value = '69.9'). - point->interact_line_chart_point( label = 'Oct' value = '0.9' secondarylabel = 'Q4' ). + point->interact_line_chart_point( selected = client->_bind( mv_sel7 ) label = 'May' value = '33.1' secondarylabel = 'Q2' ). + point->interact_line_chart_point( selected = client->_bind( mv_sel8 ) label = 'June' value = '12' ). + point->interact_line_chart_point( selected = client->_bind( mv_sel9 ) label = 'July' value = '51.4' secondarylabel = 'Q3' ). + point->interact_line_chart_point( selected = client->_bind( mv_sel10 ) label = 'Aug' value = '52' ). + point->interact_line_chart_point( selected = client->_bind( mv_sel11 ) label = 'Sep' value = '69.9'). + point->interact_line_chart_point( selected = client->_bind( mv_sel12 ) label = 'Oct' value = '0.9' secondarylabel = 'Q4' ). point = grid->flex_box( width = '22rem' @@ -324,72 +383,8 @@ CLASS z2ui5_cl_app_demo_16 IMPLEMENTATION. sice = 'S' percentage = '0.1' press = client->_event( 'RADIAL_PRESS' ) - valueColor = 'Critical' - ). + valueColor = 'Critical' ). ENDMETHOD. - - METHOD z2ui5_if_app~controller. - - CASE client->get( )-lifecycle_method. - - WHEN client->cs-lifecycle_method-on_event. - - IF check_initialized = abap_false. - check_initialized = abap_true. - - mv_path = '../../demo/text'. - mv_type = 'plain_text'. - mv_sel1 = abap_true. - - RETURN. - ENDIF. - - CASE client->get( )-event. - - WHEN 'DONUT_CHANGED'. - mv_type = 'plain_text'. - - WHEN 'DB_LOAD'. - - mv_editor = COND #( - WHEN mv_path CS 'abap' THEN lcl_mime_api=>read_abap( ) - WHEN mv_path CS 'json' THEN lcl_mime_api=>read_json( ) - WHEN mv_path CS 'yaml' THEN lcl_mime_api=>read_yaml( ) - WHEN mv_path CS 'text' THEN lcl_mime_api=>read_text( ) ). - client->popup_message_toast( 'Download successfull' ). - - WHEN 'DB_SAVE'. - lcl_mime_api=>save_data( mv_editor ). - client->popup_message_box( text = 'Upload successfull. File saved!' type = 'success' ). - - WHEN 'EDIT'. - mv_check_editable = xsdbool( mv_check_editable = abap_false ). - WHEN 'CLEAR'. - mv_editor = ``. - WHEN 'BACK'. - client->nav_app_leave( client->get( )-id_prev_app_stack ). - - ENDCASE. - - WHEN client->cs-lifecycle_method-on_rendering. - - DATA(view) = client->factory_view( 'VIEW_INPUT' ). - DATA(page) = view->page( title = 'abap2UI5 - Visualization with Charts' navbuttonpress = client->_event( 'BACK' ) ). - page->header_content( - ")->link( text = 'Demo' href = `https://twitter.com/OblomovDev/status/1634206964291911682` - )->link( text = 'Source_Code' href = client->get( )-s_request-url_source_code - ). - - DATA(container) = page->tab_container( ). - render_tab_donut( client = client container = container ). - render_tab_bar( client = client container = container ). - render_tab_line( client = client container = container ). - render_tab_radial( client = client container = container ). - - - ENDCASE. - - ENDMETHOD. ENDCLASS. diff --git a/src/00/z2ui5_cl_app_demo_20.clas.xml b/src/00/z2ui5_cl_app_demo_20.clas.xml index 07b0856c..6a32a5dd 100644 --- a/src/00/z2ui5_cl_app_demo_20.clas.xml +++ b/src/00/z2ui5_cl_app_demo_20.clas.xml @@ -5,7 +5,7 @@ Z2UI5_CL_APP_DEMO_20 E - POPUP - decide + popup - decide 1 X X diff --git a/src/00/z2ui5_cl_app_demo_24.clas.xml b/src/00/z2ui5_cl_app_demo_24.clas.xml index 6c9a4f28..5ce00f01 100644 --- a/src/00/z2ui5_cl_app_demo_24.clas.xml +++ b/src/00/z2ui5_cl_app_demo_24.clas.xml @@ -5,7 +5,7 @@ Z2UI5_CL_APP_DEMO_24 E - basic - flow logic new app + basic - flow logic 1 X X diff --git a/src/00/z2ui5_cl_app_demo_25.clas.abap b/src/00/z2ui5_cl_app_demo_25.clas.abap index 97e5a93f..9d270e41 100644 --- a/src/00/z2ui5_cl_app_demo_25.clas.abap +++ b/src/00/z2ui5_cl_app_demo_25.clas.abap @@ -24,13 +24,12 @@ ENDCLASS. -CLASS Z2UI5_CL_APP_DEMO_25 IMPLEMENTATION. +CLASS z2ui5_cl_app_demo_25 IMPLEMENTATION. METHOD factory. r_result = NEW #( ). - r_result->mo_app = i_app. r_result->mv_name_attri = i_name_attri. @@ -76,38 +75,47 @@ CLASS Z2UI5_CL_APP_DEMO_25 IMPLEMENTATION. WHEN client->cs-lifecycle_method-on_rendering. - DATA(view) = client->factory_view( 'MAIN' ). - view->page( title = 'abap2UI5 - flow logic 2' navbuttonpress = client->_event( 'BACK' ) - )->header_content( )->link( text = 'Go to Source Code' href = client->get( )-s_request-url_source_code )->get_parent( + DATA(page) = client->factory_view( 'MAIN' + )->page( + title = 'abap2UI5 - flow logic 2' + navbuttonpress = client->_event( 'BACK' ) + )->header_content( + )->link( + text = 'Go to Source Code' + href = client->get( )-s_request-url_source_code + )->get_parent( ). - )->grid( 'L6 M12 S12' )->content( 'l' + page->grid( 'L6 M12 S12' )->content( 'l' - )->simple_form( 'MAIN View' )->content( 'f' + )->simple_form( 'MAIN View' )->content( 'f' - )->label( 'Input set by previous app' - )->input( mv_input_previous_set + )->label( 'Input set by previous app' + )->input( mv_input_previous_set - )->label( 'Data of previous app' - )->input( mv_input_previous - )->button( text = 'read' press = client->_event( 'BUTTON_READ_PREVIOUS' ) + )->label( 'Data of previous app' + )->input( mv_input_previous + )->button( text = 'read' press = client->_event( 'BUTTON_READ_PREVIOUS' ) - )->label( 'Call previous app and show data of this app' - )->input( client->_bind( mv_input ) - )->button( text = 'back' press = client->_event( 'BACK_WITH_EVENT' ) - ). + )->label( 'Call previous app and show data of this app' + )->input( client->_bind( mv_input ) + )->button( text = 'back' press = client->_event( 'BACK_WITH_EVENT' ) ). - view = client->factory_view( 'SECOND' ). - view->page( title = 'abap2UI5 - flow logic 2' navbuttonpress = client->_event( 'BACK' ) - )->header_content( )->link( text = 'Go to Source Code' href = client->get( )-s_request-url_source_code )->get_parent( + page = client->factory_view( 'SECOND' + )->page( + title = 'abap2UI5 - flow logic 2' + navbuttonpress = client->_event( 'BACK' ) + )->header_content( + )->link( + text = 'Source_Code' + href = client->get( )-s_request-url_source_code + )->get_parent( ). - )->grid( 'L6 M12 S12' )->content( 'l' - - )->simple_form( 'second view set by previous app' )->content( 'f' - )->label( 'Demo' - )->button( text = 'leave to previous app' press = client->_event( 'BACK' ) - )->label( 'Demo' - )->button( text = 'show view main' press = client->_event( 'SHOW_VIEW_MAIN' ) - ). + page->grid( 'L6 M12 S12' )->content( 'l' + )->simple_form( 'second view set by previous app' )->content( 'f' + )->label( 'Demo' + )->button( text = 'leave to previous app' press = client->_event( 'BACK' ) + )->label( 'Demo' + )->button( text = 'show view main' press = client->_event( 'SHOW_VIEW_MAIN' ) ). ENDCASE. diff --git a/src/00/z2ui5_cl_app_demo_25.clas.xml b/src/00/z2ui5_cl_app_demo_25.clas.xml index 6550f4af..95cc2e34 100644 --- a/src/00/z2ui5_cl_app_demo_25.clas.xml +++ b/src/00/z2ui5_cl_app_demo_25.clas.xml @@ -5,7 +5,7 @@ Z2UI5_CL_APP_DEMO_25 E - basic - flow logic new app (called) + basic - flow logic (called) 1 X X diff --git a/src/z2ui5_cl_http_handler.clas.locals_imp.abap b/src/z2ui5_cl_http_handler.clas.locals_imp.abap index b1c6cf7a..5a18d348 100644 --- a/src/z2ui5_cl_http_handler.clas.locals_imp.abap +++ b/src/z2ui5_cl_http_handler.clas.locals_imp.abap @@ -835,27 +835,14 @@ CLASS z2ui5_lcl_utility_tree_json IMPLEMENTATION. METHOD wrap_json. - " Wrap the input text string with the opening and closing characters - " and assign the result to result - result = iv_text. - CASE mv_check_list. - WHEN abap_true. - DATA(open_char) = `[`. - DATA(close_char) = `]`. - WHEN abap_false. - open_char = `{`. - close_char = `}`. - WHEN OTHERS. - RETURN. - ENDCASE. - result = open_char && result && close_char. + result = SWITCH #( mv_check_list WHEN abap_true THEN |[ { iv_text }]| ELSE `{` && iv_text && `}` ). ENDMETHOD. METHOD quote_json. - result = COND #( WHEN iv_cond = abap_true THEN `"` && iv_text && `"` ELSE iv_text ). + result = SWITCH #( iv_cond WHEN abap_true THEN `"` && iv_text && `"` ELSE iv_text ). ENDMETHOD. @@ -873,11 +860,8 @@ CLASS z2ui5_lcl_utility_tree_json IMPLEMENTATION. IF lo_attri->mt_values IS NOT INITIAL. - result = result && lo_attri->write_result( ). - ELSE. - result = result && quote_json( iv_cond = xsdbool( lo_attri->mv_apost_active = abap_true OR lo_attri->mv_value IS INITIAL ) iv_text = lo_attri->mv_value ). @@ -1951,33 +1935,30 @@ CLASS z2ui5_lcl_if_view IMPLEMENTATION. ENDMETHOD. - METHOD z2ui5_if_view~ui_column. result = _generic( - name = `Column` - ns = `ui` - t_prop = VALUE #( - ( n = `width` v = width ) - ) ). + name = `Column` + ns = `ui` + t_prop = VALUE #( + ( n = `width` v = width ) + ) ). ENDMETHOD. METHOD z2ui5_if_view~ui_columns. result = _generic( - name = `columns` - ns = `ui` - ). + name = `columns` + ns = `ui` ). ENDMETHOD. METHOD z2ui5_if_view~ui_extension. result = _generic( - name = `extension` - ns = `ui` - ). + name = `extension` + ns = `ui` ). ENDMETHOD. @@ -2096,35 +2077,32 @@ CLASS z2ui5_lcl_if_view IMPLEMENTATION. METHOD z2ui5_if_view~tab_container. result = _generic( - name = `TabContainer` - ns = `webc` - ). + name = `TabContainer` + ns = `webc` ). ENDMETHOD. METHOD z2ui5_if_view~bars. result = _generic( - name = `bars` - ns = `mchart` - t_prop = VALUE #( - ) ). + name = `bars` + ns = `mchart` ). ENDMETHOD. METHOD z2ui5_if_view~interact_bar_chart. result = _generic( - name = `InteractiveBarChart` - ns = `mchart` - t_prop = VALUE #( + name = `InteractiveBarChart` + ns = `mchart` + t_prop = VALUE #( ( n = `selectionChanged` v = selectionchanged ) - ( n = `showError` v = showerror ) - ( n = `press` v = press ) - ( n = `labelWidth` v = labelwidth ) - ( n = `errorMessageTitle` v = errormessagetitle ) - ( n = `errorMessage` v = errormessage ) - ) ). + ( n = `showError` v = showerror ) + ( n = `press` v = press ) + ( n = `labelWidth` v = labelwidth ) + ( n = `errorMessageTitle` v = errormessagetitle ) + ( n = `errorMessage` v = errormessage ) + ) ). ENDMETHOD. @@ -2134,11 +2112,11 @@ CLASS z2ui5_lcl_if_view IMPLEMENTATION. name = `InteractiveBarChartBar` ns = `mchart` t_prop = VALUE #( - ( n = `label` v = label ) + ( n = `label` v = label ) ( n = `displayedValue` v = displayedvalue ) - ( n = `value` v = value ) - ( n = `selected` v = selected ) - ) ). + ( n = `value` v = value ) + ( n = `selected` v = selected ) + ) ). ENDMETHOD. @@ -2146,15 +2124,15 @@ CLASS z2ui5_lcl_if_view IMPLEMENTATION. result = _generic( name = `InteractiveDonutChart` - ns = `mchart` + ns = `mchart` t_prop = VALUE #( ( n = `selectionChanged` v = selectionchanged ) - ( n = `showError` v = _=>get_json_boolean( showerror ) ) - ( n = `errorMessageTitle` v = errormessagetitle ) - ( n = `errorMessage` v = errormessage ) - ( n = `displayedSegments` v = displayedsegments ) - ( n = `press` v = press ) - ) ). + ( n = `showError` v = _=>get_json_boolean( showerror ) ) + ( n = `errorMessageTitle` v = errormessagetitle ) + ( n = `errorMessage` v = errormessage ) + ( n = `displayedSegments` v = displayedsegments ) + ( n = `press` v = press ) + ) ). ENDMETHOD. @@ -2162,13 +2140,13 @@ CLASS z2ui5_lcl_if_view IMPLEMENTATION. result = _generic( name = `InteractiveDonutChartSegment` - ns = `mchart` + ns = `mchart` t_prop = VALUE #( - ( n = `label` v = label ) - ( n = `displayedValue` v = displayedvalue ) - ( n = `value` v = value ) - ( n = `selected` v = selected ) - ) ). + ( n = `label` v = label ) + ( n = `displayedValue` v = displayedvalue ) + ( n = `value` v = value ) + ( n = `selected` v = selected ) + ) ). ENDMETHOD. @@ -2179,28 +2157,28 @@ CLASS z2ui5_lcl_if_view IMPLEMENTATION. ns = `mchart` t_prop = VALUE #( ( n = `selectionChanged` v = selectionchanged ) - ( n = `showError` v = _=>get_json_boolean( showerror ) ) - ( n = `press` v = press ) - ( n = `errorMessageTitle` v = errormessagetitle ) - ( n = `errorMessage` v = errormessage ) - ( n = `precedingPoint` v = precedingpoint ) - ( n = `succeedingPoint` v = succeddingpoint ) - ) ). + ( n = `showError` v = _=>get_json_boolean( showerror ) ) + ( n = `press` v = press ) + ( n = `errorMessageTitle` v = errormessagetitle ) + ( n = `errorMessage` v = errormessage ) + ( n = `precedingPoint` v = precedingpoint ) + ( n = `succeedingPoint` v = succeddingpoint ) + ) ). ENDMETHOD. METHOD z2ui5_if_view~interact_line_chart_point. result = _generic( - name = `InteractiveLineChartPoint` - ns = `mchart` + name = `InteractiveLineChartPoint` + ns = `mchart` t_prop = VALUE #( - ( n = `label` v = label ) - ( n = `secondaryLabel` v = secondarylabel ) - ( n = `value` v = value ) - ( n = `displayedValue` v = displayedvalue ) - ( n = `selected` v = _=>get_json_boolean( selected ) ) - ) ). + ( n = `label` v = label ) + ( n = `secondaryLabel` v = secondarylabel ) + ( n = `value` v = value ) + ( n = `displayedValue` v = displayedvalue ) + ( n = `selected` v = _=>get_json_boolean( selected ) ) + ) ). ENDMETHOD. @@ -2208,9 +2186,7 @@ CLASS z2ui5_lcl_if_view IMPLEMENTATION. result = _generic( name = `points` - ns = `mchart` - t_prop = VALUE #( - ) ). + ns = `mchart` ). ENDMETHOD. @@ -2218,24 +2194,22 @@ CLASS z2ui5_lcl_if_view IMPLEMENTATION. result = me. _generic( - name = `RadialMicroChart` - ns = `mchart` + name = `RadialMicroChart` + ns = `mchart` t_prop = VALUE #( ( n = `percentage` v = percentage ) - ( n = `press` v = press ) - ( n = `sice` v = sice ) + ( n = `press` v = press ) + ( n = `sice` v = sice ) ( n = `valueColor` v = valuecolor ) - ) ). + ) ). ENDMETHOD. METHOD z2ui5_if_view~segments. result = _generic( - name = `segments` - ns = `mchart` - t_prop = VALUE #( - ) ). + name = `segments` + ns = `mchart` ). ENDMETHOD. @@ -2426,7 +2400,6 @@ CLASS z2ui5_lcl_system_app IMPLEMENTATION. view = client->factory_view( `HOME` ). DATA(page) = view->page( class = `sapUiContentPadding sapUiResponsivePadding--subHeader sapUiResponsivePadding--content sapUiResponsivePadding--footer` - " title = `abap2UI5 - Development of UI5 Apps in pure ABAP` ). page->header_content( )->title( `` @@ -2490,14 +2463,11 @@ CLASS z2ui5_lcl_db IMPLEMENTATION. METHOD create. - DATA ls_db TYPE z2ui5_t_draft. - - ls_db = VALUE #( - uuid = id - uname = _=>get_user_tech( ) - timestampl = _=>get_timestampl( ) - " response = response - data = _=>trans_object_2_xml( REF #( db ) ) ). + DATA(ls_db) = VALUE z2ui5_t_draft( + uuid = id + uname = _=>get_user_tech( ) + timestampl = _=>get_timestampl( ) + data = _=>trans_object_2_xml( REF #( db ) ) ). MODIFY z2ui5_t_draft FROM @ls_db. _=>raise( when = xsdbool( sy-subrc <> 0 ) ). @@ -2594,10 +2564,11 @@ CLASS z2ui5_lcl_system_runtime IMPLEMENTATION. DATA(lo_ui5_model) = z2ui5_lcl_utility_tree_json=>factory( ). IF lr_view IS BOUND. - DATA(ls_view) = lr_view->o_parser->get_view( ). - lo_ui5_model->add_attribute( n = `vView` v = ls_view-xml ). ms_db-view_active = lr_view->name. + + DATA(ls_view) = lr_view->o_parser->get_view( ). ls_view-o_model->mv_name = `oViewModel`. + lo_ui5_model->add_attribute( n = `vView` v = ls_view-xml ). lo_ui5_model->add_attribute_instance( ls_view-o_model ). ENDIF. @@ -2609,22 +2580,19 @@ CLASS z2ui5_lcl_system_runtime IMPLEMENTATION. ENDTRY. DATA(ls_view_popup) = lr_view_popup->o_parser->get_view( abap_true ). - - lo_ui5_model->add_attribute( n = `vViewPopup` v = ls_view_popup-xml ). ls_view_popup-o_model->mv_name = `oViewModelPopup`. + lo_ui5_model->add_attribute( n = `vViewPopup` v = ls_view_popup-xml ). lo_ui5_model->add_attribute_instance( ls_view_popup-o_model ). ENDIF. - - DATA(lo_system) = lo_ui5_model->add_attribute_object( `oSystem` ). - lo_system->add_attribute( n = `ID` v = ms_db-id ). - lo_system->add_attribute( n = `CHECK_DEBUG_ACTIVE` v = _=>get_abap_2_json( z2ui5_cl_http_handler=>cs_config-check_debug_mode ) apos_active = abap_false ). + lo_ui5_model->add_attribute_object( `oSystem` + )->add_attribute( n = `ID` v = ms_db-id + )->add_attribute( n = `CHECK_DEBUG_ACTIVE` v = _=>get_abap_2_json( z2ui5_cl_http_handler=>cs_config-check_debug_mode ) apos_active = abap_false ). IF ms_next-t_after IS NOT INITIAL. DATA(lo_list) = lo_ui5_model->add_attribute_list( `oAfter` ). LOOP AT ms_next-t_after REFERENCE INTO DATA(lr_after). DATA(lo_list2) = lo_list->add_list_list( ). - LOOP AT lr_after->* REFERENCE INTO DATA(lr_con). lo_list2->add_list_val( lr_con->* ). ENDLOOP. @@ -2637,11 +2605,11 @@ CLASS z2ui5_lcl_system_runtime IMPLEMENTATION. ENDLOOP. IF ms_next-s_cursor_pos IS NOT INITIAL. - lo_list = lo_ui5_model->add_attribute_object( `oCursor` ). - lo_list->add_attribute( n = `cursorPos` v = ms_next-s_cursor_pos-cursorpos apos_active = abap_false ). - lo_list->add_attribute( n = `id` v = ms_next-s_cursor_pos-id ). - lo_list->add_attribute( n = `selectionEnd` v = ms_next-s_cursor_pos-selectionend apos_active = abap_false ). - lo_list->add_attribute( n = `selectionStart` v = ms_next-s_cursor_pos-selectionstart apos_active = abap_false ). + lo_ui5_model->add_attribute_object( `oCursor` + )->add_attribute( n = `cursorPos` v = ms_next-s_cursor_pos-cursorpos apos_active = abap_false + )->add_attribute( n = `id` v = ms_next-s_cursor_pos-id + )->add_attribute( n = `selectionEnd` v = ms_next-s_cursor_pos-selectionend apos_active = abap_false + )->add_attribute( n = `selectionStart` v = ms_next-s_cursor_pos-selectionstart apos_active = abap_false ). ENDIF. IF ms_next-check_set_prev_view = abap_true. @@ -2649,9 +2617,7 @@ CLASS z2ui5_lcl_system_runtime IMPLEMENTATION. ENDIF. result = lo_ui5_model->get_root( )->write_result( ). - z2ui5_lcl_db=>create( - id = ms_db-id - db = ms_db ). + z2ui5_lcl_db=>create( id = ms_db-id db = ms_db ). ENDMETHOD. @@ -2695,7 +2661,6 @@ CLASS z2ui5_lcl_system_runtime IMPLEMENTATION. ENDCASE. ENDLOOP. - TRY. result->ms_next-event = ss_client-o_body->get_attribute( `OEVENT` )->get_attribute( `EVENT` )->get_val( ). CATCH cx_root. @@ -2772,7 +2737,6 @@ CLASS z2ui5_lcl_system_runtime IMPLEMENTATION. result->ms_db-id_prev_app = ms_db-id. result->ms_db-id_prev_app_stack = ms_db-id. - " result->ms_next-lifecycle_method = z2ui5_if_client=>cs-lifecycle_method-on_init. result->ms_next-lifecycle_method = z2ui5_if_client=>cs-lifecycle_method-on_event. result->ms_next-t_after = ms_next-t_after. result->ms_next-view = ms_next-view. @@ -2898,7 +2862,6 @@ CLASS z2ui5_lcl_if_client IMPLEMENTATION. ENDMETHOD. - METHOD z2ui5_if_client~popup_message_toast. INSERT VALUE #( ( `MessageToast` ) ( `show` ) ( text ) )