From a4f89a1b006e923c94e2d0cd3c1de5df75b8d0ef Mon Sep 17 00:00:00 2001 From: oblomov <102328295+oblomov-dev@users.noreply.github.com> Date: Sun, 19 Mar 2023 11:41:23 +0100 Subject: [PATCH] F4-help, formatted text, selection modes (#110) * F4-help, formatted text, selection modes * Update abaplint.jsonc * abaplint findings --- abaplint.jsonc | 2 +- src/00/z2ui5_cl_app_demo_00.clas.abap | 72 +--- src/00/z2ui5_cl_app_demo_09.clas.abap | 329 +++++++++++++++ src/00/z2ui5_cl_app_demo_09.clas.xml | 16 + src/00/z2ui5_cl_app_demo_15.clas.abap | 54 +++ .../z2ui5_cl_app_demo_15.clas.locals_imp.abap | 194 +++++++++ src/00/z2ui5_cl_app_demo_15.clas.xml | 16 + src/00/z2ui5_cl_app_demo_18.clas.abap | 8 +- src/00/z2ui5_cl_app_demo_21.clas.abap | 50 +-- ...z2ui5_cl_http_handler.clas.locals_imp.abap | 373 ++++++++++-------- src/z2ui5_if_view.intf.abap | 7 + 11 files changed, 870 insertions(+), 251 deletions(-) create mode 100644 src/00/z2ui5_cl_app_demo_09.clas.abap create mode 100644 src/00/z2ui5_cl_app_demo_09.clas.xml create mode 100644 src/00/z2ui5_cl_app_demo_15.clas.abap create mode 100644 src/00/z2ui5_cl_app_demo_15.clas.locals_imp.abap create mode 100644 src/00/z2ui5_cl_app_demo_15.clas.xml diff --git a/abaplint.jsonc b/abaplint.jsonc index 33deb1ce..7ae5113a 100644 --- a/abaplint.jsonc +++ b/abaplint.jsonc @@ -184,7 +184,7 @@ "omit_receiving": true, "parser_702_chaining": true, "parser_error": true, - "parser_missing_space": true, + "parser_missing_space": false, "pragma_style": true, "prefer_corresponding": true, "prefer_inline": { diff --git a/src/00/z2ui5_cl_app_demo_00.clas.abap b/src/00/z2ui5_cl_app_demo_00.clas.abap index 3e5b4fce..5fbf6ef4 100644 --- a/src/00/z2ui5_cl_app_demo_00.clas.abap +++ b/src/00/z2ui5_cl_app_demo_00.clas.abap @@ -21,54 +21,12 @@ CLASS z2ui5_cl_app_demo_00 IMPLEMENTATION. CASE client->get( )-event. - WHEN '0101'. - client->nav_app_call( NEW z2ui5_cl_app_demo_01( ) ). - - WHEN '0102'. - client->nav_app_call( NEW z2ui5_cl_app_demo_04( ) ). - - WHEN '0103'. - client->nav_app_call( NEW z2ui5_cl_app_demo_08( ) ). - - WHEN '0104'. - client->nav_app_call( NEW z2ui5_cl_app_demo_10( ) ). - - WHEN '0201'. - client->nav_app_call( NEW z2ui5_cl_app_demo_02( ) ). - - WHEN '0202'. - client->nav_app_call( NEW z2ui5_cl_app_demo_05( ) ). - - WHEN '0301'. - client->nav_app_call( NEW z2ui5_cl_app_demo_03( ) ). - - WHEN '0302'. - client->nav_app_call( NEW z2ui5_cl_app_demo_19( ) ). - - WHEN '0303'. - client->nav_app_call( NEW z2ui5_cl_app_demo_06( ) ). - - WHEN '0304'. - client->nav_app_call( NEW z2ui5_cl_app_demo_11( ) ). - - WHEN '0100'. - client->nav_app_call( NEW z2ui5_cl_app_demo_22( ) ). - - WHEN '2400'. - client->nav_app_call( NEW z2ui5_cl_app_demo_24( ) ). - - WHEN 'MIME_EDITOR'. - client->nav_app_call( NEW z2ui5_cl_app_demo_14( ) ). - - WHEN 'TABLE_MAINTENANCE'. - client->nav_app_call( NEW z2ui5_cl_app_demo_13( ) ). - WHEN 'BACK'. client->nav_app_leave( client->get( )-id_prev_app_stack ). WHEN OTHERS. try. - DATA(lv_classname) = client->get( )-event. + DATA(lv_classname) = to_upper( client->get( )-event ). IF lv_classname(5) <> 'Z2UI5'. RETURN. ENDIF. @@ -97,30 +55,30 @@ CLASS z2ui5_cl_app_demo_00 IMPLEMENTATION. DATA(grid) = page->grid( default_span = 'L3 M6 S12' )->content( 'l' ). grid->simple_form( 'HowTo - General' )->content( 'f' - )->button( text = 'Communication & Data Binding' press = view->_event( '0101' ) - )->button( text = 'Events, Error & Change View' press = view->_event( '0102' ) - )->button( text = 'Flow Logic' press = view->_event( '2400' ) - )->button( text = 'Messages (Toast, Box, Strip)' press = view->_event( '0103' ) - + )->button( text = 'Communication & Data Binding' press = view->_event( 'z2ui5_cl_app_demo_01' ) + )->button( text = 'Events, Error & Change View' press = view->_event( 'z2ui5_cl_app_demo_04' ) + )->button( text = 'Flow Logic' press = view->_event( 'z2ui5_cl_app_demo_24' ) + )->button( text = 'Messages (Toast, Box, Strip)' press = view->_event( 'z2ui5_cl_app_demo_08' ) ). grid->simple_form( 'HowTo - General II' )->content( 'f' - )->button( text = 'Layout (Header, Footer, Grid)' press = view->_event( '0104' ) - )->button( text = 'Scrolling & Focus' press = view->_event( '0100' ) + )->button( text = 'Layout (Header, Footer, Grid)' press = view->_event( 'z2ui5_cl_app_demo_10' ) + )->button( text = 'Scrolling & Focus' press = view->_event( 'z2ui5_cl_app_demo_22' ) )->button( text = 'Popups' press = view->_event( 'Z2UI5_CL_APP_DEMO_21' ) " )->button( text = 'Popups II (F4 Help)' press = view->_event( '0101' ) ). grid->simple_form( 'HowTo - Selection-Screen' )->content( 'f' - )->button( text = 'Basic' press = view->_event( '0201' ) - )->button( text = 'More Controls' press = view->_event( '0202' ) ). + )->button( text = 'Basic' press = view->_event( 'z2ui5_cl_app_demo_02' ) + )->button( text = 'More Controls' press = view->_event( 'z2ui5_cl_app_demo_05' ) + )->button( text = 'Formatted Text' press = view->_event( 'Z2UI5_CL_APP_DEMO_15' ) + )->button( text = 'F4-Value-Help' press = view->_event( 'Z2UI5_CL_APP_DEMO_09' ) ). grid->simple_form( 'HowTo - Tables' )->content( 'f' - )->button( text = 'List' press = view->_event( '0301' ) - )->button( text = 'Toolbar, Scroll Container' press = view->_event( '0303' ) - " )->button( text = 'Selection Modes' press = view->_event( '0302' ) - )->button( text = 'Editable' press = view->_event( '0304' ) - " )->button( text = 'Cell changes' press = view->_event( '0304' ) + )->button( text = 'List' press = view->_event( 'z2ui5_cl_app_demo_03' ) + )->button( text = 'Toolbar, Scroll Container' press = view->_event( 'z2ui5_cl_app_demo_06' ) + " )->button( text = 'Selection Modes' press = view->_event( 'z2ui5_cl_app_demo_19' ) + )->button( text = 'Editable' press = view->_event( 'z2ui5_cl_app_demo_11' ) ). grid = page->grid( default_span = 'XL9 L9 M12 S12' )->content( 'l' ). diff --git a/src/00/z2ui5_cl_app_demo_09.clas.abap b/src/00/z2ui5_cl_app_demo_09.clas.abap new file mode 100644 index 00000000..620cf465 --- /dev/null +++ b/src/00/z2ui5_cl_app_demo_09.clas.abap @@ -0,0 +1,329 @@ +CLASS z2ui5_cl_app_demo_09 DEFINITION PUBLIC. + + PUBLIC SECTION. + + INTERFACES z2ui5_if_app. + + DATA: + BEGIN OF screen, + color_01 TYPE string, + color_02 TYPE string, + color_03 TYPE string, + city TYPE string, + name TYPE string, + lastname TYPE string, + quantity TYPE string, + unit TYPE string, + END OF screen. + + TYPES: + BEGIN OF s_suggestion_items, + selkz TYPE abap_bool, + value TYPE string, + descr TYPE string, + END OF s_suggestion_items. + DATA mt_suggestion TYPE STANDARD TABLE OF s_suggestion_items WITH EMPTY KEY. + DATA mt_suggestion_sel TYPE STANDARD TABLE OF s_suggestion_items WITH EMPTY KEY. + + TYPES: + BEGIN OF s_suggestion_items_city, + value TYPE string, + descr TYPE string, + END OF s_suggestion_items_city. + DATA mt_suggestion_city TYPE STANDARD TABLE OF s_suggestion_items_city WITH EMPTY KEY. + + TYPES: + BEGIN OF s_employee, + selkz TYPE abap_bool, + city TYPE string, + nr TYPE string, + name TYPE string, + lastname TYPE string, + END OF s_employee. + DATA mt_employees_sel TYPE STANDARD TABLE OF s_employee WITH EMPTY KEY. + DATA mt_employees TYPE STANDARD TABLE OF s_employee WITH EMPTY KEY. + + + PROTECTED SECTION. + + METHODS z2ui5_on_rendering + IMPORTING + client TYPE REF TO z2ui5_if_client. + + METHODS z2ui5_on_event + IMPORTING + client TYPE REF TO z2ui5_if_client. + METHODS z2ui5_on_init. + + + PRIVATE SECTION. +ENDCLASS. + + + +CLASS z2ui5_cl_app_demo_09 IMPLEMENTATION. + + + METHOD z2ui5_if_app~controller. + + CASE client->get( )-lifecycle_method. + WHEN client->cs-lifecycle_method-on_init. + z2ui5_on_init( ). + WHEN client->cs-lifecycle_method-on_event. + z2ui5_on_event( client ). + WHEN client->cs-lifecycle_method-on_rendering. + z2ui5_on_rendering( client ). + ENDCASE. + + ENDMETHOD. + + + METHOD z2ui5_on_rendering. + + DATA(view) = client->factory_view( 'MAIN' ). + DATA(page) = view->page( title = 'abap2UI5 - Value Help Examples' navbuttontap = view->_event( 'BACK' ) ). + page->header_content( )->link( text = 'Go to Source Code' href = client->get( )-s_request-url_source_code ). + + DATA(grid) = page->grid( 'XL12 L12 M12 S12' )->content( 'l' ). + + DATA(form) = grid->simple_form( 'Input with Value Help' )->content( 'f' ). + + form->label( 'Input with sugestion items' + )->input( + value = view->_bind( screen-color_01 ) + placeholder = 'fill in your favorite colour' + suggestionitems = view->_bind_one_way( mt_suggestion ) + showsuggestion = abap_true )->get( + )->suggestion_items( )->get( + )->list_item( text = '{VALUE}' additionalText = '{DESCR}' ). + + form->label( 'Input only numbers allowed' + )->input( + value = view->_bind( screen-quantity ) + type = 'Number' + placeholder = 'quantity' ). + + form->label( 'Input with F4' + )->input( + value = view->_bind( screen-color_02 ) + placeholder = 'fill in your favorite colour' + showvaluehelp = abap_true + valuehelprequest = view->_event( 'POPUP_TABLE_F4' ) ). + + form->label( 'Custom F4 Popup' + )->input( + value = view->_bind( screen-name ) + placeholder = 'name' + showvaluehelp = abap_true + valuehelprequest = view->_event( 'POPUP_TABLE_F4_CUSTOM' ) + )->input( + value = view->_bind( screen-lastname ) + placeholder = 'lastname' + showvaluehelp = abap_true + valuehelprequest = view->_event( 'POPUP_TABLE_F4_CUSTOM' ) ). + + page->footer( )->overflow_toolbar( + )->toolbar_spacer( + )->button( + text = 'Clear' + press = view->_event( 'BUTTON_CLEAR' ) + type = 'Reject' + enabled = abap_false + icon = 'sap-icon://delete' + )->button( + text = 'Send to Server' + press = view->_event( 'BUTTON_SEND' ) + enabled = abap_false + type = 'Success' ). + + + + view = client->factory_view( 'POPUP_TABLE_F4' ). + DATA(popup) = view->dialog( title = 'abap2UI5 - F4 Value Help' ). + + DATA(tab) = popup->table( + mode = 'SingleSelectLeft' + items = view->_bind( mt_suggestion_sel ) ). + + tab->columns( + )->column( width = '20rem' )->text( 'Color' )->get_parent( + )->column( )->text( 'Description' ). + + tab->items( )->column_list_item( selected = '{SELKZ}' )->cells( + )->text( '{VALUE}' + )->text( '{DESCR}' ). + + popup->footer( )->overflow_toolbar( + )->toolbar_spacer( + )->button( + text = 'continue' + press = view->_event( 'POPUP_TABLE_F4_CONTINUE' ) + type = 'Emphasized' ). + + + + view = client->factory_view( 'POPUP_TABLE_F4_CUSTOM' ). + popup = view->dialog( title = 'abap2UI5 - F4 Value Help' ). + + popup->simple_form( + )->label( 'Location' + )->input( + value = view->_bind( screen-city ) + suggestionitems = view->_bind_one_way( mt_suggestion_city ) + showsuggestion = abap_true + )->get( + )->suggestion_items( )->get( + )->list_item( text = '{VALUE}' additionalText = '{DESCR}' + )->get_parent( )->get_parent( + )->button( text = 'search...' press = view->_event( 'SEARCH' ) + ). + + tab = popup->table( + headertext = 'Employees' + mode = 'SingleSelectLeft' + items = view->_bind( mt_employees_sel ) ). + + tab->columns( + )->column( width = '10rem' )->text( 'City' )->get_parent( + )->column( width = '10rem' )->text( 'Nr' )->get_parent( + )->column( width = '15rem' )->text( 'Name' )->get_parent( + )->column( width = '30rem' )->text( 'Lastname' )->get_parent( ). + + tab->items( )->column_list_item( selected = '{SELKZ}' )->cells( + )->text( '{CITY}' + )->text( '{NR}' + )->text( '{NAME}' + )->text( '{LASTNAME}' ). + + popup->footer( )->overflow_toolbar( + )->toolbar_spacer( + )->button( + text = 'continue' + press = view->_event( 'POPUP_TABLE_F4_CUSTOM_CONTINUE' ) + type = 'Emphasized' ). + + ENDMETHOD. + + + METHOD z2ui5_on_event. + + CASE client->get( )-event. + + WHEN 'POPUP_TABLE_F4'. + mt_suggestion_sel = mt_suggestion. + client->view_popup( 'POPUP_TABLE_F4' ). + + WHEN 'POPUP_TABLE_F4_CUSTOM'. + mt_employees_sel = VALUE #( ). + mt_employees_sel = VALUE #( ). + client->view_popup( 'POPUP_TABLE_F4_CUSTOM' ). + + WHEN 'SEARCH'. + mt_employees_sel = mt_employees. + IF screen-city IS NOT INITIAL. + DELETE mt_employees_sel WHERE city <> screen-city. + ENDIF. + client->view_popup( 'POPUP_TABLE_F4_CUSTOM' ). + + WHEN 'POPUP_TABLE_F4_CUSTOM_CONTINUE'. + DELETE mt_employees_sel WHERE selkz = abap_false. + IF lines( mt_employees_sel ) = 1. + screen-name = mt_employees_sel[ 1 ]-name. + screen-lastname = mt_employees_sel[ 1 ]-lastname. + client->popup_message_toast( 'f4 value selected' ). + ENDIF. + + WHEN 'POPUP_TABLE_F4_CONTINUE'. + DELETE mt_suggestion_sel WHERE selkz = abap_false. + IF lines( mt_suggestion_sel ) = 1. + screen-color_02 = mt_suggestion_sel[ 1 ]-value. + client->popup_message_toast( 'f4 value selected' ). + ENDIF. + + WHEN 'BUTTON_SEND'. + client->popup_message_box( 'success - values send to the server' ). + WHEN 'BUTTON_CLEAR'. + CLEAR screen. + client->popup_message_toast( 'View initialized' ). + WHEN 'BACK'. + client->nav_app_leave( client->get( )-id_prev_app_stack ). + + ENDCASE. + + client->view_show( 'MAIN' ). + + ENDMETHOD. + + + METHOD z2ui5_on_init. + + mt_suggestion = VALUE #( + ( descr = 'this is the color Green' value = 'GREEN' ) + ( descr = 'this is the color Blue' value = 'BLUE' ) + ( descr = 'this is the color Black' value = 'BLACK' ) + ( descr = 'this is the color Grey' value = 'GREY' ) + ( descr = 'this is the color Blue2' value = 'BLUE2' ) + ( descr = 'this is the color Blue3' value = 'BLUE3' ) ). + + mt_suggestion_city = VALUE #( + ( value = 'London' descr = 'London' ) + ( value = 'Paris' descr = 'Paris' ) + ( value = 'Rome' descr = 'Rome' ) ). + + mt_employees = VALUE #( + ( city = 'London' name = 'Tom' lastname = 'lastname1' nr = '00001' ) + ( city = 'London' name = 'Tom2' lastname = 'lastname2' nr = '00002' ) + ( city = 'London' name = 'Tom3' lastname = 'lastname3' nr = '00003' ) + ( city = 'London' name = 'Tom4' lastname = 'lastname4' nr = '00004' ) + ( city = 'Rome' name = 'Michaela1' lastname = 'lastname5' nr = '00005' ) + ( city = 'Rome' name = 'Michaela2' lastname = 'lastname6' nr = '00006' ) + ( city = 'Rome' name = 'Michaela3' lastname = 'lastname7' nr = '00007' ) + ( city = 'Rome' name = 'Michaela4' lastname = 'lastname8' nr = '00008' ) + ( city = 'Paris' name = 'Hermine1' lastname = 'lastname9' nr = '00009' ) + ( city = 'Paris' name = 'Hermine2' lastname = 'lastname10' nr = '00010' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) + ( city = 'Paris' name = 'Hermine3' lastname = 'lastname11' nr = '00011' ) ). + + ENDMETHOD. +ENDCLASS. diff --git a/src/00/z2ui5_cl_app_demo_09.clas.xml b/src/00/z2ui5_cl_app_demo_09.clas.xml new file mode 100644 index 00000000..07c5b1c2 --- /dev/null +++ b/src/00/z2ui5_cl_app_demo_09.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_APP_DEMO_09 + E + selscreen - f4 help + 1 + X + X + X + + + + diff --git a/src/00/z2ui5_cl_app_demo_15.clas.abap b/src/00/z2ui5_cl_app_demo_15.clas.abap new file mode 100644 index 00000000..0f93ee8d --- /dev/null +++ b/src/00/z2ui5_cl_app_demo_15.clas.abap @@ -0,0 +1,54 @@ +CLASS z2ui5_cl_app_demo_15 DEFINITION PUBLIC. + + PUBLIC SECTION. + + INTERFACES z2ui5_if_app. + + DATA mv_html_text TYPE string. + + PROTECTED SECTION. + PRIVATE SECTION. +ENDCLASS. + + + +CLASS z2ui5_cl_app_demo_15 IMPLEMENTATION. + + + METHOD z2ui5_if_app~controller. + + CASE client->get( )-lifecycle_method. + + WHEN client->cs-lifecycle_method-on_init. + + mv_html_text = `

subheader

link: link to sap.com - links open in ` && +`a new window.

paragraph: strong and emphasized.

list:

  • list item 1
  • list item 2
  • pre:

    abc    def    ghi

    code: var el = document.getElementById("myId");

    cite: a reference to a source

    ` && + `
    definition:
    definition list of terms and descriptions
    `. + + WHEN client->cs-lifecycle_method-on_event. + CASE client->get( )-event. + 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' ). + view->page( title = 'abap2UI5 - Formatted Text' navbuttontap = view->_event( 'BACK' ) + + )->header_content( + )->toolbar_spacer( + )->link( text = 'Source_Code' href = client->get( )-s_request-url_source_code + )->get_parent( + + )->vbox( 'sapUiSmallMargin' + )->link( text = 'Control Documentation - SAP UI5 Formatted Text' href = 'https://sapui5.hana.ondemand.com/#/entity/sap.m.FormattedText/sample/sap.m.sample.FormattedText' + )->get_parent( + )->vbox( 'sapUiSmallMargin' + )->formatted_text( htmltext = mv_html_text ). + + ENDCASE. + + ENDMETHOD. +ENDCLASS. diff --git a/src/00/z2ui5_cl_app_demo_15.clas.locals_imp.abap b/src/00/z2ui5_cl_app_demo_15.clas.locals_imp.abap new file mode 100644 index 00000000..09992b29 --- /dev/null +++ b/src/00/z2ui5_cl_app_demo_15.clas.locals_imp.abap @@ -0,0 +1,194 @@ +CLASS lcl_mime_api DEFINITION FINAL. + + PUBLIC SECTION. + CLASS-METHODS read_abap + RETURNING + VALUE(r_result) TYPE string. + CLASS-METHODS read_json + RETURNING + VALUE(r_result) TYPE string. + CLASS-METHODS read_js + RETURNING + VALUE(r_result) TYPE string. + CLASS-METHODS read_yaml + RETURNING + VALUE(r_result) TYPE string. + CLASS-METHODS read_text + RETURNING + VALUE(r_result) TYPE string. + + TYPES: + BEGIN OF ty_S_suggest, + name TYPE string, + value TYPE string, + END OF ty_s_suggest. + TYPES ty_T_suggest TYPE STANDARD TABLE OF ty_s_suggest WITH EMPTY KEY. + + CLASS-METHODS get_editor_type + RETURNING + VALUE(r_result) TYPE ty_t_suggest. + + CLASS-METHODS save_data + IMPORTING + i_mv_editor TYPE string. + + + PROTECTED SECTION. + + PRIVATE SECTION. + +ENDCLASS. + +CLASS lcl_mime_api IMPLEMENTATION. + + + METHOD read_abap. + +r_result = `METHOD SELECT_FILES.` && |\n| && + |\n| && + ` DATA: LV_RET_CODE TYPE I,` && |\n| && + ` LV_USR_AXN TYPE I.` && |\n| && + |\n| && + ` CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG(` && |\n| && + ` EXPORTING` && |\n| && + ` WINDOW_TITLE = 'Select file'` && |\n| && + ` MULTISELECTION = 'X'` && |\n| && + ` CHANGING` && |\n| && + ` FILE_TABLE = ME->PT_FILETAB` && |\n| && + ` RC = LV_RET_CODE` && |\n| && + ` USER_ACTION = LV_USR_AXN` && |\n| && + ` EXCEPTIONS` && |\n| && + ` FILE_OPEN_DIALOG_FAILED = 1` && |\n| && + ` CNTL_ERROR = 2` && |\n| && + ` ERROR_NO_GUI = 3` && |\n| && + ` NOT_SUPPORTED_BY_GUI = 4` && |\n| && + ` OTHERS = 5` && |\n| && + ` ).` && |\n| && + ` IF SY-SUBRC <> 0 OR` && |\n| && + ` LV_USR_AXN = CL_GUI_FRONTEND_SERVICES=>ACTION_CANCEL.` && |\n| && + ` RAISE EX_FILE_SEL_ERR.` && |\n| && + ` ENDIF.` && |\n| && + |\n| && + ` ENDMETHOD. `. + + ENDMETHOD. + + + METHOD read_json. + + r_result = `{` && |\n| && + ` "quiz": {` && |\n| && + ` "sport": {` && |\n| && + ` "q1": {` && |\n| && + ` "test" : false,` && |\n| && + ` "question": "Which one is correct team name in NBA?",` && |\n| && + ` "options": [` && |\n| && + ` "New York Bulls",` && |\n| && + ` "Los Angeles Kings",` && |\n| && + ` "Golden State Warriros",` && |\n| && + ` "Huston Rocket"` && |\n| && + ` ],` && |\n| && + ` "answer": "Huston Rocket"` && |\n| && + ` }` && |\n| && + ` },` && |\n| && + ` "maths": {` && |\n| && + ` "q1": {` && |\n| && + ` "question": "5 + 7 = ?",` && |\n| && + ` "options": [` && |\n| && + ` "10",` && |\n| && + ` "11",` && |\n| && + ` "12",` && |\n| && + ` "13"` && |\n| && + ` ],` && |\n| && + ` "answer": "12"` && |\n| && + ` },` && |\n| && + ` "q2": {` && |\n| && + ` "question": true,` && |\n| && + ` "options": [` && |\n| && + ` "1",` && |\n| && + ` "2",` && |\n| && + ` "3",` && |\n| && + ` "4"` && |\n| && + ` ],` && |\n| && + ` "answer": 487829` && |\n| && + ` }` && |\n| && + ` }` && |\n| && + ` }` && |\n| && + `}`. + + ENDMETHOD. + + + METHOD read_js. + + r_result = `function showAlert() {` && |\n| && + ` alert("Alert from JS file");` && |\n| && + `}` && |\n| && + |\n| && + `function updateHeading() {` && |\n| && + ` document.getElementById('heading').innerHTML = 'Heading changed with JS';` && |\n| && + `}`. + + ENDMETHOD. + + + METHOD read_yaml. + + r_result = `# Employee records` && |\n| && + `- martin:` && |\n| && + ` name: Martin Developer` && |\n| && + ` job: Developer` && |\n| && + ` skills:` && |\n| && + ` - python` && |\n| && + ` - perl` && |\n| && + ` - pascal` && |\n| && + `- tabitha:` && |\n| && + ` name: Tabitha Bitumen` && |\n| && + ` job: Developer` && |\n| && + ` skills:` && |\n| && + ` - lisp` && |\n| && + ` - fortran` && |\n| && + ` - erlang`. + + ENDMETHOD. + + + METHOD read_text. + r_result = `TXT test file` && |\n| && + `Purpose: Provide example of this file type` && |\n| && + `Document file type: TXT` && |\n| && + `Version: 1.0` && |\n| && + `Remark:` && |\n| && + |\n| && + `Example content:` && |\n| && + `The names "John Doe" for males, "Jane Doe" or "Jane Roe" for females, or "Jonnie Doe" and "Janie Doe" for children, or just "Doe" non-gender-specifically are used as placeholder names for a party whose true identity is unknown or mus` && +`t be withheld in a legal action, case, or discussion. The names are also used to refer to acorpse or hospital patient whose identity is unknown. This practice is widely used in the United States and Canada, but is rarely used in other English-speak` && +`ing countries including the United Kingdom itself, from where the use of "John Doe" in a legal context originates. The names Joe Bloggs or John Smith are used in the UK instead, as well as in Australia and New Zealand.` && |\n| && + |\n| && + `John Doe is sometimes used to refer to a typical male in other contexts as well, in a similar manner to John Q. Public, known in Great Britain as Joe Public, John Smith or Joe Bloggs. For example, the first name listed on a form is o` && +`ften John Doe, along with a fictional address or other fictional information to provide an example of how to fill in the form. The name is also used frequently in popular culture, for example in the Frank Capra film Meet John Doe. John Doe was also` && +` the name of a 2002 American television series.`. + ENDMETHOD. + + METHOD get_editor_type. + + DATA(lv_types) = `abap, abc, actionscript, ada, apache_conf, applescript, asciidoc, assembly_x86, autohotkey, batchfile, bro, c9search, c_cpp, cirru, clojure, cobol, coffee, coldfusion, csharp, css, curly, d, dart, diff, django, dockerfile, ` && +`dot, drools, eiffel, yaml, ejs, elixir, elm, erlang, forth, fortran, ftl, gcode, gherkin, gitignore, glsl, gobstones, golang, groovy, haml, handlebars, haskell, haskell_cabal, haxe, hjson, html, html_elixir, html_ruby, ini, io, jack, jade, java, ja` && +`vascri` && +`pt, json, jsoniq, jsp, jsx, julia, kotlin, latex, lean, less, liquid, lisp, live_script, livescript, logiql, lsl, lua, luapage, lucene, makefile, markdown, mask, matlab, mavens_mate_log, maze, mel, mips_assembler, mipsassembler, mushcode, mysql, ni` && +`x, nsis, objectivec, ocaml, pascal, perl, pgsql, php, plain_text, powershell, praat, prolog, properties, protobuf, python, r, razor, rdoc, rhtml, rst, ruby, rust, sass, scad, scala, scheme, scss, sh, sjs, smarty, snippets, soy_template, space, sql,` && +` sqlserver, stylus, svg, swift, swig, tcl, tex, text, textile, toml, tsx, twig, typescript, vala, vbscript, velocity, verilog, vhdl, wollok, xml, xquery, terraform, slim, redshift, red, puppet, php_laravel_blade, mixal, jssm, fsharp, edifact,` && +` csp, cssound_score, cssound_orchestra, cssound_document`. + SPLIT lv_types AT ',' INTO TABLE DATA(lt_types). + + + r_result = VALUE #( FOR row IN lt_types ( name = shift_right( shift_left( row ) ) value = shift_right( shift_left( row ) ) ) ). + + ENDMETHOD. + + + METHOD save_data. + "save data here + ENDMETHOD. + +ENDCLASS. diff --git a/src/00/z2ui5_cl_app_demo_15.clas.xml b/src/00/z2ui5_cl_app_demo_15.clas.xml new file mode 100644 index 00000000..16ec0241 --- /dev/null +++ b/src/00/z2ui5_cl_app_demo_15.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_APP_DEMO_15 + E + selscreen - formatted text (html) + 1 + X + X + X + + + + diff --git a/src/00/z2ui5_cl_app_demo_18.clas.abap b/src/00/z2ui5_cl_app_demo_18.clas.abap index d99bd9ae..13c28a9a 100644 --- a/src/00/z2ui5_cl_app_demo_18.clas.abap +++ b/src/00/z2ui5_cl_app_demo_18.clas.abap @@ -12,7 +12,7 @@ ENDCLASS. -CLASS Z2UI5_CL_APP_DEMO_18 IMPLEMENTATION. +CLASS z2ui5_cl_app_demo_18 IMPLEMENTATION. METHOD z2ui5_if_app~controller. @@ -58,6 +58,12 @@ CLASS Z2UI5_CL_APP_DEMO_18 IMPLEMENTATION. DATA(page) = view->page( title = 'abap2UI5 - Upload/Download Files' navbuttontap = view->_event( 'BACK' ) ). " DATA(grid) = page->grid( 'L12 M12 S12' )->content( 'l' ). + DATA(lv_html_text) = `

    subheader

    link: link to sap.com - links open in a new window.

    paragraph: strong and emphasized.

    list:

  • list item 1
  • list item 2
    • sub item 1
    • sub item 2
  • pre:

    abc    def    ghi

    code: var el = document.getElementById("myId");

    cite: a reference to a source

    ` && + `
    definition:
    definition list of terms and descriptions
    `. + + page->vbox( 'sapUiSmallMargin' )->formatted_text( htmltext = lv_html_text ). + page->zz_file_uploader( value = view->_bind( mv_value ) path = view->_bind( mv_path ) diff --git a/src/00/z2ui5_cl_app_demo_21.clas.abap b/src/00/z2ui5_cl_app_demo_21.clas.abap index 7d718b66..3220c7ad 100644 --- a/src/00/z2ui5_cl_app_demo_21.clas.abap +++ b/src/00/z2ui5_cl_app_demo_21.clas.abap @@ -101,21 +101,21 @@ CLASS z2ui5_cl_app_demo_21 IMPLEMENTATION. client->view_popup( 'POPUP_TO_TEXTAREA_SIZE' ). WHEN 'BUTTON_TEXTAREA_CONFIRM'. - " client->popup_message_box( mv_textarea ). + " client->popup_message_box( mv_textarea ). WHEN 'BUTTON_TEXTAREA_CANCEL'. client->popup_message_toast( 'textarea deleted' ). CLEAR mv_textarea. WHEN 'POPUP_TO_INPUT'. - ms_popup_input-value1 = 'value1'. + ms_popup_input-value1 = 'value1'. client->view_popup( 'POPUP_TO_INPUT' ). WHEN 'POPUP_BAL'. client->view_popup( 'POPUP_BAL' ). WHEN 'POPUP_TABLE'. - clear t_tab. + CLEAR t_tab. DO 10 TIMES. DATA(ls_row) = VALUE ty_row( title = 'entry_' && sy-index value = 'red' info = 'completed' descr = 'this is a description' ). INSERT ls_row INTO TABLE t_tab. @@ -123,14 +123,16 @@ CLASS z2ui5_cl_app_demo_21 IMPLEMENTATION. client->view_popup( 'POPUP_TABLE' ). WHEN 'POPUP_TABLE_CONTINUE'. - delete t_tab where selkz = abap_false. - client->popup_message_toast( `Entry selected: ` && t_tab[ 1 ]-title ). + DELETE t_tab WHERE selkz = abap_false. + client->popup_message_toast( `Entry selected: ` && t_tab[ 1 ]-title ). WHEN 'BACK'. client->nav_app_leave( client->get( )-id_prev_app_stack ). ENDCASE. + client->view_show( 'MAIN' ). + WHEN client->cs-lifecycle_method-on_rendering. @@ -148,7 +150,10 @@ CLASS z2ui5_cl_app_demo_21 IMPLEMENTATION. DATA(view) = i_client->factory_view( 'MAIN' ). DATA(page) = view->page( title = 'abap2UI5 - Popups' navbuttontap = view->_event( 'BACK' ) ). - page->header_content( )->link( text = 'Go to Source Code' href = i_client->get( )-s_request-url_source_code ). + page->header_content( + )->link( text = 'Demo' href = 'https://twitter.com/OblomovDev/status/1637163852264624139' + )->link( text = 'Source_Code' href = i_client->get( )-s_request-url_source_code + ). DATA(grid) = page->grid( 'XL8 L8 M12 S12' )->content( 'l' ). @@ -181,9 +186,7 @@ CLASS z2ui5_cl_app_demo_21 IMPLEMENTATION. METHOD view_popup_decide. DATA(view) = i_client->factory_view( 'POPUP_TO_DECIDE' ). - DATA(popup) = view->dialog( - title = 'Title' - icon = 'sap-icon://question-mark' ). + DATA(popup) = view->dialog( title = 'Title' icon = 'sap-icon://question-mark' ). popup->content( )->vbox( class = 'sapUiMediumMargin' )->text( text = 'This is a question, you have to make a decision now, cancel or confirm?' ). @@ -203,14 +206,8 @@ CLASS z2ui5_cl_app_demo_21 IMPLEMENTATION. METHOD view_popup_textarea. - DATA view TYPE REF TO z2ui5_if_view. - DATA popup TYPE REF TO z2ui5_if_view. - - view = i_client->factory_view( 'POPUP_TO_TEXTAREA' ). - popup = view->dialog( - stretch = mv_stretch_active - title = 'Title' - icon = 'sap-icon://edit' ). + DATA(view) = i_client->factory_view( 'POPUP_TO_TEXTAREA' ). + DATA(popup) = view->dialog( stretch = mv_stretch_active title = 'Title' icon = 'sap-icon://edit' ). popup->content( )->text_area( @@ -234,7 +231,7 @@ CLASS z2ui5_cl_app_demo_21 IMPLEMENTATION. contentheight = '100px' contentwidth = '1200px' title = 'Title' - icon = 'sap-icon://edit' ). + icon = 'sap-icon://edit' ). popup->content( )->text_area( @@ -257,13 +254,8 @@ CLASS z2ui5_cl_app_demo_21 IMPLEMENTATION. METHOD view_popup_input. - - - DATA popup TYPE REF TO z2ui5_if_view. - DATA view TYPE REF TO z2ui5_if_view. - - view = i_client->factory_view( 'POPUP_TO_INPUT' ). - popup = view->dialog( + DATA(view) = i_client->factory_view( 'POPUP_TO_INPUT' ). + DATA(popup) = view->dialog( contentheight = '500px' contentwidth = '500px' title = 'Title' ). @@ -271,9 +263,9 @@ CLASS z2ui5_cl_app_demo_21 IMPLEMENTATION. popup->content( )->simple_form( )->label( 'Input1' - )->input( view->_bind( ms_popup_input-value1 ) + )->input( view->_bind( ms_popup_input-value1 ) )->label( 'Input2' - )->input( view->_bind( ms_popup_input-value2 ) + )->input( view->_bind( ms_popup_input-value2 ) )->label( 'Checkbox' )->checkbox( selected = view->_bind( ms_popup_input-check_is_active ) @@ -296,13 +288,13 @@ CLASS z2ui5_cl_app_demo_21 IMPLEMENTATION. METHOD view_popup_table. DATA(view) = i_client->factory_view( 'POPUP_BAL' ). - DATA(popup) = view->dialog( title = 'abap2ui5 - Popup Message Log:' ). + DATA(popup) = view->dialog( title = 'abap2ui5 - Popup Message Log' ). DATA(tab) = popup->table( view->_bind( t_bapiret ) ). tab->columns( )->column( width = '5rem' )->text( 'Type' )->get_parent( )->column( width = '5rem' )->text( 'Number' )->get_parent( - )->column( width = '5rem' )->text( 'ID' )->get_parent( + )->column( width = '5rem' )->text( 'ID' )->get_parent( )->column( )->text( 'Message' )->get_parent( ). tab->items( )->column_list_item( )->cells( diff --git a/src/z2ui5_cl_http_handler.clas.locals_imp.abap b/src/z2ui5_cl_http_handler.clas.locals_imp.abap index 0158b391..80f8a096 100644 --- a/src/z2ui5_cl_http_handler.clas.locals_imp.abap +++ b/src/z2ui5_cl_http_handler.clas.locals_imp.abap @@ -69,25 +69,25 @@ CLASS z2ui5_lcl_utility DEFINITION INHERITING FROM cx_no_check. IMPORTING in TYPE REF TO object RETURNING - VALUE(r_result) TYPE string. + VALUE(result) TYPE string. CLASS-METHODS get_uuid RETURNING - VALUE(r_result) TYPE string + VALUE(result) TYPE string RAISING cx_uuid_error. CLASS-METHODS get_uuid_session RETURNING - VALUE(r_result) TYPE string. + VALUE(result) TYPE string. CLASS-METHODS get_user_tech RETURNING - VALUE(r_result) TYPE string. + VALUE(result) TYPE string. CLASS-METHODS get_timestampl RETURNING - VALUE(r_result) TYPE timestampl. + VALUE(result) TYPE timestampl. CLASS-METHODS trans_json_2_data IMPORTING @@ -113,13 +113,13 @@ CLASS z2ui5_lcl_utility DEFINITION INHERITING FROM cx_no_check. io_app TYPE REF TO object t_attri TYPE ty-t-attri RETURNING - VALUE(r_result) TYPE string ##NEEDED. + VALUE(result) TYPE string ##NEEDED. CLASS-METHODS get_t_attri_by_ref IMPORTING io_app TYPE REF TO object RETURNING - VALUE(r_result) TYPE ty-t-attri ##NEEDED. + VALUE(result) TYPE ty-t-attri ##NEEDED. CLASS-METHODS trans_object_2_xml IMPORTING @@ -132,13 +132,13 @@ CLASS z2ui5_lcl_utility DEFINITION INHERITING FROM cx_no_check. url TYPE string name TYPE string RETURNING - VALUE(r_result) TYPE string. + VALUE(result) TYPE string. CLASS-METHODS get_prev_when_no_handler IMPORTING val TYPE REF TO cx_root RETURNING - VALUE(r_result) TYPE REF TO cx_root. + VALUE(result) TYPE REF TO cx_root. CLASS-METHODS get_ref_data IMPORTING @@ -151,13 +151,19 @@ CLASS z2ui5_lcl_utility DEFINITION INHERITING FROM cx_no_check. IMPORTING val TYPE any RETURNING - VALUE(r_result) TYPE string. + VALUE(result) TYPE string. + + CLASS-METHODS check_is_boolean + IMPORTING + val TYPE any + RETURNING + VALUE(result) TYPE abap_bool. CLASS-METHODS get_json_boolean IMPORTING val TYPE any RETURNING - VALUE(r_result) TYPE string. + VALUE(result) TYPE string. CLASS-METHODS trans_ref_tab_2_tab IMPORTING ir_tab_from TYPE REF TO data @@ -167,7 +173,7 @@ CLASS z2ui5_lcl_utility DEFINITION INHERITING FROM cx_no_check. IMPORTING val TYPE clike RETURNING - VALUE(r_result) TYPE string. + VALUE(result) TYPE string. PROTECTED SECTION. @@ -178,7 +184,7 @@ CLASS z2ui5_lcl_utility DEFINITION INHERITING FROM cx_no_check. io_app TYPE REF TO object iv_attri TYPE csequence RETURNING - VALUE(r_result) TYPE abap_attrdescr_tab. + VALUE(result) TYPE abap_attrdescr_tab. PRIVATE SECTION. @@ -188,8 +194,8 @@ ENDCLASS. CLASS z2ui5_lcl_utility IMPLEMENTATION. METHOD get_trim_upper. - r_result = val. - r_result = to_upper( shift_left( shift_right( r_result ) ) ). + result = val. + result = to_upper( shift_left( shift_right( result ) ) ). ENDMETHOD. @@ -214,34 +220,59 @@ CLASS z2ui5_lcl_utility IMPLEMENTATION. METHOD get_abap_2_json. - DATA lo_ele TYPE REF TO cl_abap_elemdescr. - lo_ele ?= cl_abap_elemdescr=>describe_by_data( val ). - CASE lo_ele->get_relative_name( ). - WHEN 'ABAP_BOOL' OR 'ABAP_BOOLEAN'. - r_result = COND #( WHEN val = abap_true THEN 'true' ELSE 'false' ). - WHEN OTHERS. - r_result = |"{ escape( val = val format = cl_abap_format=>e_json_string ) }"|. - ENDCASE. +* DATA lo_ele TYPE REF TO cl_abap_elemdescr. +* lo_ele ?= cl_abap_elemdescr=>describe_by_data( val ). +* CASE lo_ele->get_relative_name( ). +* WHEN 'ABAP_BOOL' OR 'ABAP_BOOLEAN' OR 'XSDBOOLEAN'. +* result = COND #( WHEN val = abap_true THEN 'true' ELSE 'false' ). +* WHEN OTHERS. +* result = |"{ escape( val = val format = cl_abap_format=>e_json_string ) }"|. +* ENDCASE. + + IF check_is_boolean( val ). + result = COND #( WHEN val = abap_true THEN 'true' ELSE 'false' ). + ELSE. + result = |"{ escape( val = val format = cl_abap_format=>e_json_string ) }"|. + ENDIF. + + ENDMETHOD. + + METHOD check_is_boolean. + + TRY. + DATA(lo_ele) = CAST cl_abap_elemdescr( cl_abap_elemdescr=>describe_by_data( val ) ). + CASE lo_ele->get_relative_name( ). + WHEN 'ABAP_BOOL' OR 'ABAP_BOOLEAN' OR 'XSDBOOLEAN'. + result = abap_true. + ENDCASE. + CATCH cx_root. + ENDTRY. ENDMETHOD. METHOD get_json_boolean. - DATA lo_ele TYPE REF TO cl_abap_elemdescr. - lo_ele ?= cl_abap_elemdescr=>describe_by_data( val ). - CASE lo_ele->get_relative_name( ). - WHEN 'ABAP_BOOL' OR 'ABAP_BOOLEAN'. - r_result = COND #( WHEN val = abap_true THEN 'true' ELSE 'false' ). - WHEN OTHERS. - r_result = val. - ENDCASE. +* DATA lo_ele TYPE REF TO cl_abap_elemdescr. +* lo_ele ?= cl_abap_elemdescr=>describe_by_data( val ). +* CASE lo_ele->get_relative_name( ). +* WHEN 'ABAP_BOOL' OR 'ABAP_BOOLEAN' OR 'XSDBOOLEAN'. +* result = COND #( WHEN val = abap_true THEN 'true' ELSE 'false' ). +* WHEN OTHERS. +* result = val. +* ENDCASE. + + IF check_is_boolean( val ). + result = COND #( WHEN val = abap_true THEN 'true' ELSE 'false' ). + ELSE. + result = val. + ENDIF. ENDMETHOD. METHOD get_classname_by_ref. DATA(lv_classname) = cl_abap_classdescr=>get_class_name( in ). - r_result = substring_after( val = lv_classname sub = '\CLASS=' ). + result = substring_after( val = lv_classname sub = '\CLASS=' ). ENDMETHOD. @@ -262,7 +293,7 @@ CLASS z2ui5_lcl_utility IMPLEMENTATION. v = lv_value ) INTO TABLE lt_url_params. ENDLOOP. - r_result = lt_url_params[ n = get_trim_upper( name ) ]-v. + result = lt_url_params[ n = get_trim_upper( name ) ]-v. ENDMETHOD. @@ -270,12 +301,12 @@ CLASS z2ui5_lcl_utility IMPLEMENTATION. METHOD get_prev_when_no_handler. TRY. - r_result = CAST cx_sy_no_handler( val )->previous. + result = CAST cx_sy_no_handler( val )->previous. CATCH cx_root. ENDTRY. - IF r_result IS NOT BOUND. - r_result = val. + IF result IS NOT BOUND. + result = val. ENDIF. ENDMETHOD. @@ -295,14 +326,14 @@ CLASS z2ui5_lcl_utility IMPLEMENTATION. METHOD get_timestampl. - GET TIME STAMP FIELD r_result. + GET TIME STAMP FIELD result. ENDMETHOD. METHOD get_user_tech. - r_result = sy-uname. + result = sy-uname. ENDMETHOD. @@ -325,14 +356,14 @@ CLASS z2ui5_lcl_utility IMPLEMENTATION. ENDTRY. - r_result = uuid. + result = uuid. ENDMETHOD. METHOD get_uuid_session. mv_counter = mv_counter + 1. - r_result = shift_left( shift_right( CONV string( mv_counter ) ) ). + result = shift_left( shift_right( CONV string( mv_counter ) ) ). ENDMETHOD. @@ -354,7 +385,7 @@ CLASS z2ui5_lcl_utility IMPLEMENTATION. GET REFERENCE OF INTO lr_ref. IF lr_in = lr_ref. - r_result = to_upper( lr_attri->name ). + result = to_upper( lr_attri->name ). EXIT. ENDIF. @@ -384,7 +415,7 @@ CLASS z2ui5_lcl_utility IMPLEMENTATION. ENDLOOP. - r_result = CORRESPONDING #( lt_attri ). + result = CORRESPONDING #( lt_attri ). ENDMETHOD. @@ -406,11 +437,11 @@ CLASS z2ui5_lcl_utility IMPLEMENTATION. IF lr_comp->as_include = abap_true. INSERT LINES OF _get_t_attri( io_app = io_app - iv_attri = lv_element ) INTO TABLE r_result. + iv_attri = lv_element ) INTO TABLE result. ELSE. INSERT VALUE #( name = lv_element - type_kind = lr_comp->type->type_kind ) INTO TABLE r_result. + type_kind = lr_comp->type->type_kind ) INTO TABLE result. ENDIF. ENDLOOP. @@ -566,39 +597,39 @@ CLASS z2ui5_lcl_utility_tree_json DEFINITION. io_root TYPE REF TO z2ui5_lcl_utility_tree_json iv_name TYPE simple RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_utility_tree_json. + VALUE(result) TYPE REF TO z2ui5_lcl_utility_tree_json. CLASS-METHODS factory IMPORTING iv_json TYPE clike OPTIONAL RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_utility_tree_json. + VALUE(result) TYPE REF TO z2ui5_lcl_utility_tree_json. METHODS constructor. METHODS get_root RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_utility_tree_json. + VALUE(result) TYPE REF TO z2ui5_lcl_utility_tree_json. METHODS get_attribute IMPORTING name TYPE string RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_utility_tree_json. + VALUE(result) TYPE REF TO z2ui5_lcl_utility_tree_json. METHODS get_val RETURNING - VALUE(r_result) TYPE string. + VALUE(result) TYPE string. METHODS get_parent RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_utility_tree_json. + VALUE(result) TYPE REF TO z2ui5_lcl_utility_tree_json. METHODS add_list_val IMPORTING v TYPE string RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_utility_tree_json. + VALUE(result) TYPE REF TO z2ui5_lcl_utility_tree_json. METHODS add_attribute IMPORTING @@ -606,47 +637,47 @@ CLASS z2ui5_lcl_utility_tree_json DEFINITION. v TYPE clike apos_active TYPE abap_bool DEFAULT abap_true RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_utility_tree_json. + VALUE(result) TYPE REF TO z2ui5_lcl_utility_tree_json. METHODS add_attributes_name_value_tab IMPORTING it_name_value TYPE ty_T_name_value RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_utility_tree_json. + VALUE(result) TYPE REF TO z2ui5_lcl_utility_tree_json. METHODS add_attribute_object IMPORTING name TYPE clike RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_utility_tree_json. + VALUE(result) TYPE REF TO z2ui5_lcl_utility_tree_json. METHODS add_list_object RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_utility_tree_json. + VALUE(result) TYPE REF TO z2ui5_lcl_utility_tree_json. METHODS add_list_list RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_utility_tree_json. + VALUE(result) TYPE REF TO z2ui5_lcl_utility_tree_json. METHODS add_attribute_list IMPORTING name TYPE clike RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_utility_tree_json. + VALUE(result) TYPE REF TO z2ui5_lcl_utility_tree_json. METHODS add_attribute_instance IMPORTING val TYPE REF TO z2ui5_lcl_utility_tree_json RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_utility_tree_json. + VALUE(result) TYPE REF TO z2ui5_lcl_utility_tree_json. METHODS write_result RETURNING - VALUE(r_result) TYPE string. + VALUE(result) TYPE string. METHODS get_name RETURNING - VALUE(r_result) TYPE string. + VALUE(result) TYPE string. PROTECTED SECTION. @@ -654,14 +685,14 @@ CLASS z2ui5_lcl_utility_tree_json DEFINITION. IMPORTING iv_text TYPE string RETURNING - VALUE(r_result) TYPE string. + VALUE(result) TYPE string. METHODS quote_json IMPORTING iv_text TYPE string iv_cond TYPE abap_bool RETURNING - VALUE(r_result) TYPE string. + VALUE(result) TYPE string. ENDCLASS. @@ -683,7 +714,7 @@ CLASS z2ui5_lcl_utility_tree_json IMPLEMENTATION. lo_attri->mo_parent = me. INSERT lo_attri INTO TABLE mt_values. - r_result = me. + result = me. ENDMETHOD. @@ -697,7 +728,7 @@ CLASS z2ui5_lcl_utility_tree_json IMPLEMENTATION. apos_active = xsdbool( ls_value-no_apos = abap_false ) ). ENDLOOP. - r_result = me. + result = me. ENDMETHOD. @@ -707,15 +738,15 @@ CLASS z2ui5_lcl_utility_tree_json IMPLEMENTATION. val->mo_root = mo_root. val->mo_parent = me. INSERT val INTO TABLE mt_values. - r_result = val. + result = val. ENDMETHOD. METHOD add_attribute_list. - r_result = add_attribute_object( name = name ). - r_result->mv_check_list = abap_true. + result = add_attribute_object( name = name ). + result->mv_check_list = abap_true. ENDMETHOD. @@ -725,21 +756,21 @@ CLASS z2ui5_lcl_utility_tree_json IMPLEMENTATION. DATA(lo_attri) = new( io_root = mo_root iv_name = name ). mt_values = VALUE #( BASE mt_values ( lo_attri ) ). lo_attri->mo_parent = me. - r_result = lo_attri. + result = lo_attri. ENDMETHOD. METHOD add_list_list. - r_result = add_attribute_list( name = CONV string( lines( mt_values ) ) ). + result = add_attribute_list( name = CONV string( lines( mt_values ) ) ). ENDMETHOD. METHOD add_list_object. - r_result = add_attribute_object( name = CONV string( lines( mt_values ) ) ). + result = add_attribute_object( name = CONV string( lines( mt_values ) ) ). ENDMETHOD. @@ -752,8 +783,8 @@ CLASS z2ui5_lcl_utility_tree_json IMPLEMENTATION. mt_values = VALUE #( BASE mt_values ( lo_attri ) ). lo_attri->mo_parent = me. - r_result = lo_attri. - r_result = me. + result = lo_attri. + result = me. ENDMETHOD. @@ -767,24 +798,24 @@ CLASS z2ui5_lcl_utility_tree_json IMPLEMENTATION. METHOD factory. - r_result = NEW #( ). - r_result->mo_root = r_result. + result = NEW #( ). + result->mo_root = result. /ui2/cl_json=>deserialize( EXPORTING json = CONV string( iv_json ) assoc_arrays = abap_true CHANGING - data = r_result->mr_actual + data = result->mr_actual ). ENDMETHOD. METHOD new. - r_result = NEW #( ). - r_result->mo_root = io_root. - r_result->mv_name = CONV string( iv_name ). + result = NEW #( ). + result->mo_root = io_root. + result->mv_name = CONV string( iv_name ). ENDMETHOD. @@ -807,7 +838,7 @@ CLASS z2ui5_lcl_utility_tree_json IMPLEMENTATION. INSERT lo_attri INTO TABLE mt_values. - r_result = lo_attri. + result = lo_attri. ENDMETHOD. @@ -817,35 +848,35 @@ CLASS z2ui5_lcl_utility_tree_json IMPLEMENTATION. ASSIGN mr_actual->* TO . _=>raise( when = xsdbool( sy-subrc <> 0 ) v = `Value of Attribute in JSON not found` ). - r_result = . + result = . ENDMETHOD. METHOD get_name. - r_result = mv_name. + result = mv_name. ENDMETHOD. METHOD get_parent. - r_result = COND #( WHEN mo_parent IS NOT BOUND THEN me ELSE mo_parent ). + result = COND #( WHEN mo_parent IS NOT BOUND THEN me ELSE mo_parent ). ENDMETHOD. METHOD get_root. - r_result = mo_root. + result = mo_root. ENDMETHOD. METHOD wrap_json. " Wrap the input text string with the opening and closing characters - " and assign the result to r_result - r_result = iv_text. + " and assign the result to result + result = iv_text. CASE mv_check_list. WHEN abap_true. @@ -857,13 +888,13 @@ CLASS z2ui5_lcl_utility_tree_json IMPLEMENTATION. WHEN OTHERS. RETURN. ENDCASE. - r_result = open_char && r_result && close_char. + result = open_char && result && close_char. ENDMETHOD. METHOD quote_json. - r_result = COND #( WHEN iv_cond = abap_true THEN `"` && iv_text && `"` ELSE iv_text ). + result = COND #( WHEN iv_cond = abap_true THEN `"` && iv_text && `"` ELSE iv_text ). ENDMETHOD. @@ -872,28 +903,28 @@ CLASS z2ui5_lcl_utility_tree_json IMPLEMENTATION. LOOP AT mt_values INTO DATA(lo_attri). IF sy-tabix > 1. - r_result = r_result && |,|. + result = result && |,|. ENDIF. IF mv_check_list = abap_false. - r_result = r_result && |"{ lo_attri->mv_name }":|. + result = result && |"{ lo_attri->mv_name }":|. ENDIF. IF lo_attri->mt_values IS NOT INITIAL. - r_result = r_result && lo_attri->write_result( ). + result = result && lo_attri->write_result( ). ELSE. - r_result = r_result && + 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 ). ENDIF. ENDLOOP. - r_result = wrap_json( r_result ). + result = wrap_json( result ). ENDMETHOD. ENDCLASS. @@ -951,7 +982,7 @@ CLASS z2ui5_lcl_if_view DEFINITION. value TYPE data type TYPE string DEFAULT cs-bind_type-two_way RETURNING - VALUE(r_result) TYPE string. + VALUE(result) TYPE string. PROTECTED SECTION. @@ -1038,7 +1069,7 @@ CLASS z2ui5_lcl_system_runtime DEFINITION. CLASS-METHODS execute_init RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_system_runtime. + VALUE(result) TYPE REF TO z2ui5_lcl_system_runtime. METHODS execute_before_app IMPORTING @@ -1048,32 +1079,32 @@ CLASS z2ui5_lcl_system_runtime DEFINITION. METHODS execute_finish RETURNING - VALUE(r_result) TYPE string. + VALUE(result) TYPE string. CLASS-METHODS set_app_start RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_system_runtime. + VALUE(result) TYPE REF TO z2ui5_lcl_system_runtime. CLASS-METHODS set_app_client_update IMPORTING id_prev TYPE clike RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_system_runtime. + VALUE(result) TYPE REF TO z2ui5_lcl_system_runtime. METHODS set_app_leave_to_id RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_system_runtime. + VALUE(result) TYPE REF TO z2ui5_lcl_system_runtime. METHODS set_app_call_new RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_system_runtime. + VALUE(result) TYPE REF TO z2ui5_lcl_system_runtime. METHODS set_app_system_error IMPORTING kind TYPE string ix TYPE REF TO cx_root RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_system_runtime. + VALUE(result) TYPE REF TO z2ui5_lcl_system_runtime. PRIVATE SECTION. @@ -1119,7 +1150,7 @@ CLASS z2ui5_lcl_if_view IMPLEMENTATION. data_stringify = _=>trans_any_2_json( value ) bind_type = type ) INTO TABLE m_root->mo_runtime->ms_db-t_attri. - r_result = '/' && lv_id && ''. + result = '/' && lv_id && ''. RETURN. ENDIF. @@ -1136,7 +1167,7 @@ CLASS z2ui5_lcl_if_view IMPLEMENTATION. IF lr_in = lr_ref. lr_attri->bind_type = type. - r_result = COND #( WHEN type = cs-bind_type-two_way THEN '/oUpdate/' ELSE '/' ) && lr_attri->name. + result = COND #( WHEN type = cs-bind_type-two_way THEN '/oUpdate/' ELSE '/' ) && lr_attri->name. RETURN. ENDIF. @@ -1149,7 +1180,7 @@ CLASS z2ui5_lcl_if_view IMPLEMENTATION. data_stringify = _=>trans_any_2_json( value ) bind_type = cs-bind_type-one_time ) INTO TABLE m_root->mo_runtime->ms_db-t_attri. - r_result = '/' && lv_id && ''. + result = '/' && lv_id && ''. ENDMETHOD. @@ -1271,6 +1302,17 @@ CLASS z2ui5_lcl_if_view IMPLEMENTATION. ENDMETHOD. + METHOD z2ui5_if_view~formatted_text. + + result = me. + _generic( + name = 'FormattedText' + t_prop = VALUE #( + ( n = 'htmlText' v = htmlText ) + ) ). + + ENDMETHOD. + METHOD z2ui5_if_view~badge_custom_data. result = me. @@ -1407,6 +1449,7 @@ CLASS z2ui5_lcl_if_view IMPLEMENTATION. ( n = 'title' v = title ) ( n = 'showNavButton' v = COND #( WHEN navbuttontap = '' THEN 'false' ELSE 'true' ) ) ( n = 'navButtonTap' v = navbuttontap ) + ( n = 'class' v = class ) ( n = 'id' v = id ) ) ). @@ -2320,7 +2363,7 @@ CLASS z2ui5_lcl_system_app DEFINITION. app TYPE REF TO object OPTIONAL kind TYPE string OPTIONAL RETURNING - VALUE(r_result) TYPE REF TO z2ui5_lcl_system_app. + VALUE(result) TYPE REF TO z2ui5_lcl_system_app. PROTECTED SECTION. @@ -2355,10 +2398,10 @@ CLASS z2ui5_lcl_system_app IMPLEMENTATION. METHOD factory_error. - r_result = NEW #( ). - r_result->ms_error-x_error = error. - r_result->ms_error-app ?= app. - r_result->ms_error-kind = kind. + result = NEW #( ). + result->ms_error-x_error = error. + result->ms_error-app ?= app. + result->ms_error-kind = kind. ENDMETHOD. @@ -2468,7 +2511,9 @@ CLASS z2ui5_lcl_system_app IMPLEMENTATION. ENDIF. view = client->factory_view( 'HOME' ). - DATA(page) = view->page( 'abap2UI5 - Development of UI5 Apps in pure ABAP' ). + DATA(page) = view->page( + class = 'sapUiContentPadding sapUiResponsivePadding--header sapUiResponsivePadding--subHeader sapUiResponsivePadding--content sapUiResponsivePadding--footer' + title = 'abap2UI5 - Development of UI5 Apps in pure ABAP' ). page->header_content( )->link( text = 'SCN' href = 'https://blogs.sap.com/tag/abap2ui5/' )->link( text = 'Twitter' href = 'https://twitter.com/OblomovDev' @@ -2505,7 +2550,6 @@ CLASS z2ui5_lcl_system_app IMPLEMENTATION. DATA(lv_link) = client->get( )-s_request-url_app_gen && ms_home-classname. form->link( text = 'Link to the Application' href = lv_link enabled = xsdbool( ms_home-class_editable = abap_false ) ). - " grid = page->grid( default_span = 'L12 M12 S12' )->content( 'l' grid->simple_form( 'Applications and Examples' )->content( 'f' )->button( text = `Press to continue..` press = view->_event( 'DEMOS' ) ). @@ -2604,11 +2648,11 @@ CLASS z2ui5_lcl_system_runtime IMPLEMENTATION. TRY. DATA(lv_id_prev) = ss_client-o_body->get_attribute( 'OSYSTEM' )->get_attribute( 'ID' )->get_val( ). CATCH cx_root. - r_result = set_app_start( ). + result = set_app_start( ). RETURN. ENDTRY. - r_result = set_app_client_update( lv_id_prev ). + result = set_app_client_update( lv_id_prev ). ENDMETHOD. @@ -2629,6 +2673,7 @@ CLASS z2ui5_lcl_system_runtime IMPLEMENTATION. ELSEIF ms_actual-view_active IS NOT INITIAL. TRY. lr_screen = REF #( ms_next-t_screen[ name = ms_actual-view_active ] ). + ms_next-view = ms_actual-view_active. CATCH cx_root. _=>raise( `View with the name ` && ms_actual-view_active && ` not found - check the rendering` ). ENDTRY. @@ -2701,11 +2746,11 @@ CLASS z2ui5_lcl_system_runtime IMPLEMENTATION. IF ms_next-check_set_prev_view = abap_true. lo_ui5_model->add_attribute( n = 'SET_PREV_VIEW' v = 'true' apos_active = abap_false ). ENDIF. - r_result = lo_ui5_model->get_root( )->write_result( ). + result = lo_ui5_model->get_root( )->write_result( ). z2ui5_lcl_db=>create( id = ms_db-id - response = r_result + response = result db = ms_db ). ENDMETHOD. @@ -2713,21 +2758,21 @@ CLASS z2ui5_lcl_system_runtime IMPLEMENTATION. METHOD set_app_client_update. - CONSTANTS c_prefix TYPE string VALUE `R_RESULT->MS_DB-O_APP->`. + CONSTANTS c_prefix TYPE string VALUE `result->MS_DB-O_APP->`. - r_result = NEW #( ). - DATA(lv_id) = r_result->ms_db-id. - r_result->ms_db = z2ui5_lcl_db=>load_app( id_prev ). - r_result->ms_db-id = lv_id. - r_result->ms_db-id_prev = id_prev. + result = NEW #( ). + DATA(lv_id) = result->ms_db-id. + result->ms_db = z2ui5_lcl_db=>load_app( id_prev ). + result->ms_db-id = lv_id. + result->ms_db-id_prev = id_prev. DATA(lo_system) = ss_client-o_body->get_attribute( 'OSYSTEM' ). TRY. - r_result->ms_next-view_popup = lo_system->get_attribute( 'VIEW_POPUP' )->get_val( ). + result->ms_next-view_popup = lo_system->get_attribute( 'VIEW_POPUP' )->get_val( ). DATA(lo_popup_model) = ss_client-o_body->get_attribute( 'OPOPUP' ). - LOOP AT r_result->ms_db-t_attri REFERENCE INTO DATA(lr_attri) + LOOP AT result->ms_db-t_attri REFERENCE INTO DATA(lr_attri) WHERE bind_type = z2ui5_if_view=>cs-bind_type-two_way. FIELD-SYMBOLS TYPE any. @@ -2751,7 +2796,7 @@ CLASS z2ui5_lcl_system_runtime IMPLEMENTATION. CATCH cx_root. - LOOP AT r_result->ms_db-t_attri REFERENCE INTO lr_attri + LOOP AT result->ms_db-t_attri REFERENCE INTO lr_attri WHERE bind_type = z2ui5_if_view=>cs-bind_type-two_way. lv_name = c_prefix && to_upper( lr_attri->name ). @@ -2777,73 +2822,75 @@ CLASS z2ui5_lcl_system_runtime IMPLEMENTATION. TRY. - r_result->ms_next-event = ss_client-o_body->get_attribute( 'OEVENT' )->get_attribute( 'EVENT' )->get_val( ). + result->ms_next-event = ss_client-o_body->get_attribute( 'OEVENT' )->get_attribute( 'EVENT' )->get_val( ). CATCH cx_root. ENDTRY. * TRY. -* r_result->ms_next-page_scroll_pos = ss_client-o_body->get_attribute( 'scrollPos' )->get_val( ). +* result->ms_next-page_scroll_pos = ss_client-o_body->get_attribute( 'scrollPos' )->get_val( ). * CATCH cx_root. * ENDTRY. TRY. - r_result->ms_next-view = lo_system->get_attribute( 'VIEW' )->get_val( ). + result->ms_next-view = lo_system->get_attribute( 'VIEW' )->get_val( ). CATCH cx_root. ENDTRY. TRY. - r_result->ms_next-view = lo_system->get_attribute( 'VIEW_NAME' )->get_val( ). + result->ms_next-view = lo_system->get_attribute( 'VIEW_NAME' )->get_val( ). CATCH cx_root. ENDTRY. * TRY. -* r_result->ms_next-view = lo_system->get_attribute( 'VIEW_POPUP_NAME' )->get_val( ). +* result->ms_next-view = lo_system->get_attribute( 'VIEW_POPUP_NAME' )->get_val( ). * CATCH cx_root. * ENDTRY. - r_result->ms_next-lifecycle_method = z2ui5_if_client=>cs-lifecycle_method-on_event. + result->ms_next-lifecycle_method = z2ui5_if_client=>cs-lifecycle_method-on_event. ENDMETHOD. METHOD set_app_start. - r_result = NEW #( ). + result = NEW #( ). DO. TRY. - r_result->ms_db-app_classname = to_upper( ss_client-t_param[ name = 'app' ]-value ). + result->ms_db-app_classname = to_upper( ss_client-t_param[ name = 'app' ]-value ). CATCH cx_root ##CATCH_ALL. - r_result->ms_db-o_app = NEW z2ui5_lcl_system_app( ). + result->ms_db-o_app = NEW z2ui5_lcl_system_app( ). EXIT. ENDTRY. TRY. - CREATE OBJECT r_result->ms_db-o_app TYPE (r_result->ms_db-app_classname). + CREATE OBJECT result->ms_db-o_app TYPE (result->ms_db-app_classname). EXIT. CATCH cx_root ##CATCH_ALL. DATA(lo_error) = NEW z2ui5_lcl_system_app( ). lo_error->ms_error-x_error = NEW z2ui5_lcl_utility( - val = `class with name ` && r_result->ms_db-app_classname && ` not found, app call not possible` ). - r_result->ms_db-o_app = lo_error. + val = `class with name ` && result->ms_db-app_classname && ` not found, app call not possible` ). + result->ms_db-o_app = lo_error. EXIT. ENDTRY. ENDDO. - r_result->ms_db-app_classname = _=>get_classname_by_ref( r_result->ms_db-o_app ). - r_result->ms_db-t_attri = _=>get_t_attri_by_ref( r_result->ms_db-o_app ). - r_result->ms_next-lifecycle_method = z2ui5_if_client=>cs-lifecycle_method-on_init. + result->ms_db-app_classname = _=>get_classname_by_ref( result->ms_db-o_app ). + result->ms_db-t_attri = _=>get_t_attri_by_ref( result->ms_db-o_app ). + result->ms_next-lifecycle_method = z2ui5_if_client=>cs-lifecycle_method-on_init. ENDMETHOD. METHOD set_app_leave_to_id. - r_result = NEW #( ). - r_result->ms_db = z2ui5_lcl_db=>load_app( ms_next-nav_app_leave_to_id ). + result = NEW #( ). + result->ms_db = z2ui5_lcl_db=>load_app( ms_next-nav_app_leave_to_id ). - r_result->ms_next = ms_next. - r_result->ms_next-lifecycle_method = z2ui5_if_client=>cs-lifecycle_method-on_event. + result->ms_next = ms_next. + result->ms_next-view = ''. + result->ms_next-view_popup = ''. + result->ms_next-lifecycle_method = z2ui5_if_client=>cs-lifecycle_method-on_event. CLEAR ms_next. - r_result->ms_db-id_prev_app = ms_db-id. - r_result->ms_db-id_prev = ms_db-id. + result->ms_db-id_prev_app = ms_db-id. + result->ms_db-id_prev = ms_db-id. z2ui5_lcl_db=>create( id = ms_db-id db = ms_db ). @@ -2853,38 +2900,38 @@ CLASS z2ui5_lcl_system_runtime IMPLEMENTATION. z2ui5_lcl_db=>create( id = ms_db-id db = ms_db ). - r_result = NEW #( ). - r_result->ms_db-o_app = ms_next-s_nav_app_call_new-o_app. - r_result->ms_db-app_classname = _=>get_classname_by_ref( r_result->ms_db-o_app ). + result = NEW #( ). + result->ms_db-o_app = ms_next-s_nav_app_call_new-o_app. + result->ms_db-app_classname = _=>get_classname_by_ref( result->ms_db-o_app ). - r_result->ms_db-id_prev_app = ms_db-id. - r_result->ms_db-id_prev_app_stack = ms_db-id. + result->ms_db-id_prev_app = ms_db-id. + result->ms_db-id_prev_app_stack = ms_db-id. - r_result->ms_next-lifecycle_method = z2ui5_if_client=>cs-lifecycle_method-on_init. - r_result->ms_next-t_after = ms_next-t_after. - r_result->ms_next-view = ms_next-view. - r_result->ms_next-event = ms_next-event. + result->ms_next-lifecycle_method = z2ui5_if_client=>cs-lifecycle_method-on_init. + result->ms_next-t_after = ms_next-t_after. + result->ms_next-view = ms_next-view. + result->ms_next-event = ms_next-event. - r_result->ms_db-t_attri = _=>get_t_attri_by_ref( r_result->ms_db-o_app ). + result->ms_db-t_attri = _=>get_t_attri_by_ref( result->ms_db-o_app ). ENDMETHOD. METHOD set_app_system_error. z2ui5_lcl_db=>create( id = ms_db-id db = ms_db ). - r_result = NEW #( ). - r_result->ms_db-o_app = z2ui5_lcl_system_app=>factory_error( error = ix app = ms_db-o_app kind = kind ). - r_result->ms_db-app_classname = _=>get_classname_by_ref( r_result->ms_db-o_app ). + result = NEW #( ). + result->ms_db-o_app = z2ui5_lcl_system_app=>factory_error( error = ix app = ms_db-o_app kind = kind ). + result->ms_db-app_classname = _=>get_classname_by_ref( result->ms_db-o_app ). - r_result->ms_db-id_prev_app = ms_db-id. - r_result->ms_db-id_prev_app_stack = ms_db-id. + result->ms_db-id_prev_app = ms_db-id. + result->ms_db-id_prev_app_stack = ms_db-id. - r_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_init. - r_result->ms_next-t_after = ms_next-t_after. - r_result->ms_db-t_attri = _=>get_t_attri_by_ref( r_result->ms_db-o_app ). + result->ms_next-t_after = ms_next-t_after. + result->ms_db-t_attri = _=>get_t_attri_by_ref( result->ms_db-o_app ). - r_result->ms_db-id_prev_app = ms_db-id. + result->ms_db-id_prev_app = ms_db-id. ms_actual-lifecycle_method = z2ui5_if_client=>cs-lifecycle_method-on_init. ENDMETHOD. diff --git a/src/z2ui5_if_view.intf.abap b/src/z2ui5_if_view.intf.abap index 839e78d6..a5250ab9 100644 --- a/src/z2ui5_if_view.intf.abap +++ b/src/z2ui5_if_view.intf.abap @@ -369,6 +369,7 @@ INTERFACE z2ui5_if_view title TYPE clike OPTIONAL navbuttontap TYPE clike OPTIONAL id TYPE clike OPTIONAL + class type clike optional PREFERRED PARAMETER title RETURNING VALUE(result) TYPE REF TO z2ui5_if_view. @@ -641,6 +642,12 @@ INTERFACE z2ui5_if_view RETURNING VALUE(result) TYPE REF TO z2ui5_if_view. + METHODS formatted_text + IMPORTING + htmlText TYPE clike optional + RETURNING + VALUE(result) TYPE REF TO z2ui5_if_view. + METHODS _generic IMPORTING name TYPE clike