refactoring, cleanup, bugfixes (#134)

* bugfixes and flow logic

* Bugfixes

* refactoring

* bugfixes flow

* bugfixes

* cleanup utility class types

* bugfixes

* abalint fix
This commit is contained in:
oblomov 2023-03-30 23:27:57 +02:00
parent 3b690c572b
commit 3a08e5cdda
5 changed files with 87 additions and 102 deletions

View File

@ -135,80 +135,6 @@ CLASS z2ui5_cl_app_demo_09 IMPLEMENTATION.
ENDMETHOD. 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.
METHOD z2ui5_on_rendering. METHOD z2ui5_on_rendering.
DATA(page) = client->factory_view( 'MAIN' DATA(page) = client->factory_view( 'MAIN'
@ -307,7 +233,7 @@ CLASS z2ui5_cl_app_demo_09 IMPLEMENTATION.
type = 'Emphasized' ). type = 'Emphasized' ).
data(popup) = client->factory_view( 'POPUP_TABLE_F4_CUSTOM' DATA(popup) = client->factory_view( 'POPUP_TABLE_F4_CUSTOM'
)->dialog( 'abap2UI5 - F4 Value Help' ). )->dialog( 'abap2UI5 - F4 Value Help' ).
popup->simple_form( popup->simple_form(
@ -325,7 +251,7 @@ CLASS z2ui5_cl_app_demo_09 IMPLEMENTATION.
text = 'search...' text = 'search...'
press = client->_event( 'SEARCH' ) ). press = client->_event( 'SEARCH' ) ).
data(tab) = popup->table( DATA(tab) = popup->table(
headertext = 'Employees' headertext = 'Employees'
mode = 'SingleSelectLeft' mode = 'SingleSelectLeft'
items = client->_bind( mt_employees_sel ) ). items = client->_bind( mt_employees_sel ) ).
@ -356,4 +282,79 @@ CLASS z2ui5_cl_app_demo_09 IMPLEMENTATION.
type = 'Emphasized' ). type = 'Emphasized' ).
ENDMETHOD. 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. ENDCLASS.

View File

@ -36,7 +36,7 @@ CLASS Z2UI5_CL_APP_DEMO_12 IMPLEMENTATION.
WHEN 'BUTTON_POPUP_03'. WHEN 'BUTTON_POPUP_03'.
client->show_view( 'MAIN' ). client->show_view( 'MAIN' ).
client->popup_view( 'POPUP_DECIDE_FRONTEND_CLOSE' ). client->popup_view( 'POPUP_INFO_FRONTEND_CLOSE' ).
WHEN 'BUTTON_POPUP_04'. WHEN 'BUTTON_POPUP_04'.
client->set( set_prev_view = abap_true ). client->set( set_prev_view = abap_true ).
@ -124,7 +124,7 @@ CLASS Z2UI5_CL_APP_DEMO_12 IMPLEMENTATION.
type = 'Emphasized' ). type = 'Emphasized' ).
client->factory_view( 'POPUP_DECIDE_FRONTEND_CLOSE' client->factory_view( 'POPUP_INFO_FRONTEND_CLOSE'
)->dialog( 'Popup - Info' )->dialog( 'Popup - Info'
)->vbox( )->vbox(
)->text( 'this is an information, press close to go back to the main view without a server roundtrip' )->text( 'this is an information, press close to go back to the main view without a server roundtrip'

View File

@ -64,7 +64,7 @@ CLASS Z2UI5_CL_APP_DEMO_19 IMPLEMENTATION.
DATA(page) = client->factory_view( DATA(page) = client->factory_view(
)->page( )->page(
title = 'abap2UI5 - Table with different Selection-Modes' title = 'abap2UI5 - Table with different Selection Modes'
navbuttonpress = client->_event( 'BACK' ) navbuttonpress = client->_event( 'BACK' )
)->header_content( )->header_content(
)->link( )->link(

View File

@ -17,11 +17,6 @@ CLASS z2ui5_cl_http_handler DEFINITION
t_param TYPE z2ui5_if_client=>ty_t_name_value, t_param TYPE z2ui5_if_client=>ty_t_name_value,
END OF client. END OF client.
"! loads the one page ui5 application
"! @parameter library_path | choose your ui5 license here, see sap note 3207822 and 2943781
"! @parameter theme | sap_horizon, sap_belize, ...
"! @parameter title | browser title
"! @parameter r_result | index.html
CLASS-METHODS main_index_html CLASS-METHODS main_index_html
IMPORTING IMPORTING
library_path TYPE clike DEFAULT `https://ui5.sap.com/resources/sap-ui-core.js` library_path TYPE clike DEFAULT `https://ui5.sap.com/resources/sap-ui-core.js`

View File

@ -10,6 +10,8 @@ CLASS z2ui5_lcl_utility DEFINITION INHERITING FROM cx_no_check.
data_stringify TYPE string, data_stringify TYPE string,
END OF ty_attri. END OF ty_attri.
types ty_T_attri TYPE STANDARD TABLE OF ty_attri WITH EMPTY KEY.
TYPES ty_tt_string TYPE STANDARD TABLE OF string_table WITH EMPTY KEY. TYPES ty_tt_string TYPE STANDARD TABLE OF string_table WITH EMPTY KEY.
TYPES: TYPES:
@ -20,24 +22,11 @@ CLASS z2ui5_lcl_utility DEFINITION INHERITING FROM cx_no_check.
TYPES ty_t_name_value TYPE STANDARD TABLE OF ty_s_name_value WITH EMPTY KEY. TYPES ty_t_name_value TYPE STANDARD TABLE OF ty_s_name_value WITH EMPTY KEY.
TYPES:
BEGIN OF ty,
BEGIN OF s,
BEGIN OF msg_result,
message TYPE string,
s_bapi TYPE LINE OF bapirettab,
END OF msg_result,
END OF s,
BEGIN OF t,
attri TYPE STANDARD TABLE OF ty_attri WITH EMPTY KEY,
END OF t,
END OF ty.
DATA: DATA:
BEGIN OF ms_error, BEGIN OF ms_error,
x_root TYPE REF TO cx_root, x_root TYPE REF TO cx_root,
uuid TYPE string, uuid TYPE string,
s_msg TYPE ty-s-msg_result, s_msg TYPE LINE OF bapirettab,
END OF ms_error. END OF ms_error.
METHODS constructor METHODS constructor
@ -98,7 +87,7 @@ CLASS z2ui5_lcl_utility DEFINITION INHERITING FROM cx_no_check.
IMPORTING IMPORTING
i_focus TYPE data i_focus TYPE data
io_app TYPE REF TO object io_app TYPE REF TO object
t_attri TYPE ty-t-attri t_attri TYPE ty_t_attri
RETURNING RETURNING
VALUE(result) TYPE string ##NEEDED. VALUE(result) TYPE string ##NEEDED.
@ -106,7 +95,7 @@ CLASS z2ui5_lcl_utility DEFINITION INHERITING FROM cx_no_check.
IMPORTING IMPORTING
io_app TYPE REF TO object io_app TYPE REF TO object
RETURNING RETURNING
VALUE(result) TYPE ty-t-attri ##NEEDED. VALUE(result) TYPE ty_t_attri ##NEEDED.
CLASS-METHODS trans_object_2_xml CLASS-METHODS trans_object_2_xml
IMPORTING IMPORTING
@ -899,7 +888,7 @@ CLASS z2ui5_lcl_if_view DEFINITION.
BEGIN OF ty_s_view, BEGIN OF ty_s_view,
xml TYPE string, xml TYPE string,
o_model TYPE REF TO z2ui5_lcl_utility_tree_json, o_model TYPE REF TO z2ui5_lcl_utility_tree_json,
t_attri TYPE _=>ty-t-attri, t_attri TYPE _=>ty_t_attri,
END OF ty_s_view. END OF ty_s_view.
DATA m_name TYPE string. DATA m_name TYPE string.
@ -984,7 +973,7 @@ CLASS z2ui5_lcl_system_runtime DEFINITION.
id_prev_app_stack TYPE string, id_prev_app_stack TYPE string,
view_active TYPE string, view_active TYPE string,
t_attri TYPE _=>ty-t-attri, t_attri TYPE _=>ty_t_attri,
o_app TYPE REF TO object, o_app TYPE REF TO object,
app_classname TYPE string, app_classname TYPE string,
END OF ty_s_db. END OF ty_s_db.