diff --git a/src/01/package.devc.xml b/src/01/package.devc.xml new file mode 100644 index 0000000..dc7c262 --- /dev/null +++ b/src/01/package.devc.xml @@ -0,0 +1,10 @@ + + + + + + launchpad + + + + diff --git a/src/01/z2ui5_cl_demo_app_lp_01.clas.abap b/src/01/z2ui5_cl_demo_app_lp_01.clas.abap new file mode 100644 index 0000000..ed0b15b --- /dev/null +++ b/src/01/z2ui5_cl_demo_app_lp_01.clas.abap @@ -0,0 +1,50 @@ +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. +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->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 + )->content( 'form' + )->label( `` + )->button( text = 'Read Parameters' + press = client->_event( val = 'READ_PARAMS' ) + )->label( `` + )->button( text = 'Go Back' + press = client->_event( val = 'BACK' ) )->stringify( ) ). + + ENDIF. + + CASE client->get( )-event. + + WHEN 'READ_PARAMS'. + DATA(lv_text) = `Start Parameter: `. + DATA(lt_params) = client->get( )-t_comp_params. + LOOP AT lt_params INTO DATA(ls_param). + lv_text = |{ lv_text } / { ls_param-n } = { ls_param-v }|. + ENDLOOP. + client->message_box_display( lv_text ). + + WHEN 'BACK'. + client->nav_app_leave( ). + ENDCASE. + + ENDMETHOD. +ENDCLASS. diff --git a/src/01/z2ui5_cl_demo_app_lp_01.clas.xml b/src/01/z2ui5_cl_demo_app_lp_01.clas.xml new file mode 100644 index 0000000..5ac9c9f --- /dev/null +++ b/src/01/z2ui5_cl_demo_app_lp_01.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_DEMO_APP_LP_01 + E + launchpad I - Startup Parameters + 1 + X + X + X + + + + diff --git a/src/01/z2ui5_cl_demo_app_lp_02.clas.abap b/src/01/z2ui5_cl_demo_app_lp_02.clas.abap new file mode 100644 index 0000000..b28d332 --- /dev/null +++ b/src/01/z2ui5_cl_demo_app_lp_02.clas.abap @@ -0,0 +1,60 @@ +CLASS z2ui5_cl_demo_app_lp_02 DEFINITION PUBLIC. + + PUBLIC SECTION. + INTERFACES z2ui5_if_app. + + DATA mv_title TYPE string VALUE `my title`. + DATA check_initialized TYPE abap_bool. + + PROTECTED SECTION. + + PRIVATE SECTION. +ENDCLASS. + + + +CLASS Z2UI5_CL_DEMO_APP_LP_02 IMPLEMENTATION. + + + METHOD z2ui5_if_app~main. + IF check_initialized = abap_false. + check_initialized = abap_true. + + 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 ) ). + ELSE. + page = shell->page( title = client->_bind_edit( mv_title ) ). + ENDIF. + + client->view_display( page->simple_form( title = 'Set Launchpad Title Dynamically' editable = abap_true + )->content( 'form' + )->label( `` + )->input( client->_bind_edit( mv_title ) + )->label( `` + )->button( text = 'Go Back' + press = client->_event( val = 'BACK' ) )->stringify( ) ). + + ENDIF. + + CASE client->get( )-event. + + WHEN 'READ_PARAMS'. + DATA(lv_text) = `Start Parameter: `. + DATA(lt_params) = client->get( )-t_comp_params. + LOOP AT lt_params INTO DATA(ls_param). + lv_text = |{ lv_text } / { ls_param-n } = { ls_param-v }|. + ENDLOOP. + client->message_box_display( lv_text ). + + WHEN 'BACK'. + client->nav_app_leave( ). + ENDCASE. + + ENDMETHOD. +ENDCLASS. diff --git a/src/01/z2ui5_cl_demo_app_lp_02.clas.xml b/src/01/z2ui5_cl_demo_app_lp_02.clas.xml new file mode 100644 index 0000000..b65475f --- /dev/null +++ b/src/01/z2ui5_cl_demo_app_lp_02.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_DEMO_APP_LP_02 + E + launchpad II - Set Title + 1 + X + X + X + + + + diff --git a/src/01/z2ui5_cl_demo_app_lp_03.clas.abap b/src/01/z2ui5_cl_demo_app_lp_03.clas.abap new file mode 100644 index 0000000..ad4dfb8 --- /dev/null +++ b/src/01/z2ui5_cl_demo_app_lp_03.clas.abap @@ -0,0 +1,83 @@ +CLASS z2ui5_cl_demo_app_lp_03 DEFINITION PUBLIC. + + PUBLIC SECTION. + + INTERFACES z2ui5_if_app. + +* DATA product TYPE string. +* DATA quantity TYPE string. + DATA check_initialized TYPE abap_bool. + + DATA: + BEGIN OF nav_params, + product TYPE string, + quantity TYPE string, + END OF nav_params. + + PROTECTED SECTION. + PRIVATE SECTION. +ENDCLASS. + + + +CLASS z2ui5_cl_demo_app_lp_03 IMPLEMENTATION. + + + METHOD z2ui5_if_app~main. + + DATA(lt_startup_params) = client->get( )-s_config-t_startup_params. + + IF check_initialized = abap_false. + check_initialized = abap_true. + + nav_params-product = '102343333'. + + 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( ). + client->view_display( view->shell( + )->page( + 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 ) + )->header_content( + )->link( + text = 'Source_Code' + + target = '_blank' + )->get_parent( + )->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 = 'go to app 128' + press = client->_event_client( + 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 ) ) + ) + ) + )->stringify( ) ). + + ENDIF. + + CASE client->get( )-event. + + WHEN 'BUTTON_POST'. + +* 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 ) ). + + ENDCASE. + + ENDMETHOD. +ENDCLASS. diff --git a/src/01/z2ui5_cl_demo_app_lp_03.clas.xml b/src/01/z2ui5_cl_demo_app_lp_03.clas.xml new file mode 100644 index 0000000..f3b0abe --- /dev/null +++ b/src/01/z2ui5_cl_demo_app_lp_03.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_DEMO_APP_LP_03 + E + Launchpad III - cross app navigation I + 1 + X + X + X + + + + diff --git a/src/01/z2ui5_cl_demo_app_lp_04.clas.abap b/src/01/z2ui5_cl_demo_app_lp_04.clas.abap new file mode 100644 index 0000000..5d9f5cf --- /dev/null +++ b/src/01/z2ui5_cl_demo_app_lp_04.clas.abap @@ -0,0 +1,85 @@ +CLASS z2ui5_cl_demo_app_lp_04 DEFINITION PUBLIC. + + PUBLIC SECTION. + + INTERFACES z2ui5_if_app. + + 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. + PRIVATE SECTION. +ENDCLASS. + + + +CLASS z2ui5_cl_demo_app_lp_04 IMPLEMENTATION. + + + METHOD z2ui5_if_app~main. + + DATA(view) = z2ui5_cl_xml_view=>factory( ). + product_url = z2ui5_cl_util=>url_param_get( + 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. + + quantity = '500'. + + client->view_display( view->shell( + )->page( + 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 ) + )->header_content( + )->link( + text = 'Source_Code' + + target = '_blank' + )->get_parent( + )->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( + 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" }`) ) + ) + )->stringify( ) ). + + ENDIF. + + client->view_model_update( ). + + CASE client->get( )-event. + + WHEN 'BUTTON_POST'. + +* 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 ) ). + + ENDCASE. + + ENDMETHOD. +ENDCLASS. diff --git a/src/01/z2ui5_cl_demo_app_lp_04.clas.xml b/src/01/z2ui5_cl_demo_app_lp_04.clas.xml new file mode 100644 index 0000000..a711b53 --- /dev/null +++ b/src/01/z2ui5_cl_demo_app_lp_04.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_DEMO_APP_LP_04 + E + Launchpad IV - cross app navigation II + 1 + X + X + X + + + +