Skip to content

refactoring #501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/00/z2ui5_cl_demo_app_326.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CLASS z2ui5_cl_demo_app_326 DEFINITION PUBLIC CREATE PUBLIC.

DATA unit TYPE meins.
DATA numc TYPE z2ui5_numc12.
DATA check_initialized TYPE abap_bool.


PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.
Expand All @@ -30,8 +30,7 @@ CLASS z2ui5_cl_demo_app_326 IMPLEMENTATION.

me->client = client.

IF check_initialized = abap_false.
check_initialized = abap_true.
IF client->check_on_init( ).
display_view( client ).
z2ui5_set_data( ).
ENDIF.
Expand Down
8 changes: 4 additions & 4 deletions src/01/z2ui5_cl_demo_app_lp_01.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CLASS z2ui5_cl_demo_app_lp_01 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.

DATA check_initialized TYPE abap_bool.


PROTECTED SECTION.
PRIVATE SECTION.
Expand All @@ -12,16 +12,16 @@ ENDCLASS.

CLASS z2ui5_cl_demo_app_lp_01 IMPLEMENTATION.
METHOD z2ui5_if_app~main.
IF check_initialized = abap_false.
check_initialized = abap_true.
IF client->check_on_init( ).

IF client->get( )-check_launchpad_active = abap_false.
client->message_box_display( `No Launchpad Active, Sample not working!` ).
ENDIF.

DATA(view) = z2ui5_cl_xml_view=>factory( ).
DATA(page) = view->shell( )->page( showheader = abap_false ).
client->view_display( page->simple_form( title = 'Laucnhpad I - Read Startup Parameters' editable = abap_true
client->view_display( page->simple_form( title = 'Laucnhpad I - Read Startup Parameters'
editable = abap_true
)->content( 'form'
)->label( ``
)->button( text = 'Read Parameters'
Expand Down
16 changes: 8 additions & 8 deletions src/01/z2ui5_cl_demo_app_lp_02.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CLASS z2ui5_cl_demo_app_lp_02 DEFINITION PUBLIC.
INTERFACES z2ui5_if_app.

DATA mv_title TYPE string VALUE `my title`.
DATA check_initialized TYPE abap_bool.


PROTECTED SECTION.

Expand All @@ -17,22 +17,22 @@ CLASS Z2UI5_CL_DEMO_APP_LP_02 IMPLEMENTATION.


METHOD z2ui5_if_app~main.
IF check_initialized = abap_false.
check_initialized = abap_true.
IF client->check_on_init( ).

IF client->get( )-check_launchpad_active = abap_false.
client->message_box_display( `No Launchpad Active, Sample not working!` ).
ENDIF.

DATA(shell) = z2ui5_cl_xml_view=>factory( )->shell( ).
IF client->get( )-check_launchpad_active = abap_true.
DATA(page) = shell->page( showheader = abap_false ).
page->_z2ui5( )->lp_title( client->_bind_edit( mv_title ) ).
DATA(page) = shell->page( showheader = abap_false ).
page->_z2ui5( )->lp_title( client->_bind_edit( mv_title ) ).
ELSE.
page = shell->page( title = client->_bind_edit( mv_title ) ).
page = shell->page( title = client->_bind_edit( mv_title ) ).
ENDIF.

client->view_display( page->simple_form( title = 'Set Launchpad Title Dynamically' editable = abap_true
client->view_display( page->simple_form( title = 'Set Launchpad Title Dynamically'
editable = abap_true
)->content( 'form'
)->label( ``
)->input( client->_bind_edit( mv_title )
Expand All @@ -42,7 +42,7 @@ CLASS Z2UI5_CL_DEMO_APP_LP_02 IMPLEMENTATION.

ENDIF.

CASE client->get( )-event.
CASE client->get( )-event.

WHEN 'READ_PARAMS'.
DATA(lv_text) = `Start Parameter: `.
Expand Down
23 changes: 12 additions & 11 deletions src/01/z2ui5_cl_demo_app_lp_03.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CLASS z2ui5_cl_demo_app_lp_03 DEFINITION PUBLIC.

* DATA product TYPE string.
* DATA quantity TYPE string.
DATA check_initialized TYPE abap_bool.


DATA:
BEGIN OF nav_params,
Expand All @@ -27,8 +27,7 @@ CLASS z2ui5_cl_demo_app_lp_03 IMPLEMENTATION.

DATA(lt_startup_params) = client->get( )-s_config-t_startup_params.

IF check_initialized = abap_false.
check_initialized = abap_true.
IF client->check_on_init( ).

nav_params-product = '102343333'.

Expand All @@ -39,26 +38,28 @@ CLASS z2ui5_cl_demo_app_lp_03 IMPLEMENTATION.
DATA(view) = z2ui5_cl_xml_view=>factory( ).
client->view_display( view->shell(
)->page(
showheader = xsdbool( abap_false = client->get( )-check_launchpad_active )
showheader = xsdbool( abap_false = client->get( )-check_launchpad_active )
title = 'abap2UI5 - Cross App Navigation App 127 - This App only works when started via Launchpad'
navbuttonpress = client->_event( val = 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
)->header_content(
)->link(
text = 'Source_Code'
text = 'Source_Code'

target = '_blank'
)->get_parent(
)->simple_form( title = 'App 127' editable = abap_true
)->simple_form( title = 'App 127'
editable = abap_true
)->content( 'form'
)->label( `Product`
)->input( client->_bind_edit( nav_params-product )
)->button( text = 'BACK' press = client->_event_client( client->cs_event-cross_app_nav_to_prev_app )
)->button( text = 'BACK'
press = client->_event_client( client->cs_event-cross_app_nav_to_prev_app )
)->button(
text = 'go to app 128'
press = client->_event_client(
val = client->cs_event-cross_app_nav_to_ext
t_arg = VALUE #(
val = client->cs_event-cross_app_nav_to_ext
t_arg = VALUE #(
( `{ semanticObject: "Z2UI5_CL_LP_SAMPLE_04", action: "display" }` )
* ( `{ "Product" : "102343333" }` )
( `$` && client->_bind_edit( nav_params ) )
Expand All @@ -75,7 +76,7 @@ CLASS z2ui5_cl_demo_app_lp_03 IMPLEMENTATION.
* client->message_toast_display( |{ product } { quantity } - send to the server| ).

WHEN 'BACK'.
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).

ENDCASE.

Expand Down
37 changes: 19 additions & 18 deletions src/01/z2ui5_cl_demo_app_lp_04.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CLASS z2ui5_cl_demo_app_lp_04 DEFINITION PUBLIC.
DATA product TYPE string.
DATA product_url TYPE string.
DATA quantity TYPE string.
DATA check_initialized TYPE abap_bool.

DATA check_launchpad_active TYPE abap_bool.

PROTECTED SECTION.
Expand All @@ -23,46 +23,47 @@ CLASS z2ui5_cl_demo_app_lp_04 IMPLEMENTATION.

DATA(view) = z2ui5_cl_xml_view=>factory( ).
product_url = z2ui5_cl_util=>url_param_get(
val = `product`
val = `product`
url = client->get( )-s_config-search ).
check_launchpad_active = client->get( )-check_launchpad_active.

data(lt_params) = client->get( )-t_comp_params.
try.
product = lt_params[ n = `PRODUCT` ]-v.
catch cx_root.
endtry.
IF check_initialized = abap_false.
check_initialized = abap_true.
DATA(lt_params) = client->get( )-t_comp_params.
TRY.
product = lt_params[ n = `PRODUCT` ]-v.
CATCH cx_root.
ENDTRY.
IF client->check_on_init( ).

quantity = '500'.

client->view_display( view->shell(
)->page(
showheader = xsdbool( abap_false = client->get( )-check_launchpad_active )
showheader = xsdbool( abap_false = client->get( )-check_launchpad_active )
title = 'abap2UI5 - Cross App Navigation App 128'
navbuttonpress = client->_event( val = 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
)->header_content(
)->link(
text = 'Source_Code'
text = 'Source_Code'

target = '_blank'
)->get_parent(
)->simple_form( title = 'App 128' editable = abap_true
)->simple_form( title = 'App 128'
editable = abap_true
)->content( 'form'
)->title( 'Input'
)->label( 'product nav param'
)->input( client->_bind_edit( product )
)->label( `CHECK_LAUNCHPAD_ACTIVE`
)->input( check_launchpad_active
)->button( press = client->_event( )
)->button( text = 'BACK' press = client->_event_client( client->cs_event-cross_app_nav_to_prev_app )
)->button( press = client->_event( )
)->button( text = 'BACK'
press = client->_event_client( client->cs_event-cross_app_nav_to_prev_app )
)->button(
text = 'go to app 127'
press = client->_event_client(
val = client->cs_event-cross_app_nav_to_ext
t_arg = VALUE #( ( `{ semanticObject: "Z2UI5_CL_LP_SAMPLE_03", action: "display" }` ) ( `{ ProductID : "123234" }`) )
val = client->cs_event-cross_app_nav_to_ext
t_arg = VALUE #( ( `{ semanticObject: "Z2UI5_CL_LP_SAMPLE_03", action: "display" }` ) ( `{ ProductID : "123234" }`) )
)
)->stringify( ) ).

Expand All @@ -77,7 +78,7 @@ CLASS z2ui5_cl_demo_app_lp_04 IMPLEMENTATION.
* client->message_toast_display( |{ product } { quantity } - send to the server| ).

WHEN 'BACK'.
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).

ENDCASE.

Expand Down
Loading