diff --git a/src/01/z2ui5_cl_cc_sample_favicon.clas.abap b/src/01/z2ui5_cl_cc_sample_favicon.clas.abap new file mode 100644 index 0000000..1510462 --- /dev/null +++ b/src/01/z2ui5_cl_cc_sample_favicon.clas.abap @@ -0,0 +1,65 @@ +CLASS z2ui5_cl_cc_sample_favicon DEFINITION PUBLIC. + + PUBLIC SECTION. + + INTERFACES z2ui5_if_app. + + DATA favicon TYPE string. + DATA check_initialized TYPE abap_bool. + + PROTECTED SECTION. + data client type ref to z2ui5_if_client. + METHODS display_view. + PRIVATE SECTION. +ENDCLASS. + + + +CLASS Z2UI5_CL_CC_SAMPLE_FAVICON IMPLEMENTATION. + + + METHOD display_view. + + DATA(view) = z2ui5_cl_xml_view=>factory( ). + + DATA(tmp) = view->_z2ui5( )->favicon( favicon = client->_bind_edit( favicon ) + )->shell( + )->page( + title = 'abap2UI5 - Change Tab Favicon' + navbuttonpress = client->_event( val = 'BACK' ) + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) + )->simple_form( title = 'Form Title' editable = abap_true + )->content( 'form' + )->label( 'favicon' + )->input( client->_bind_edit( favicon ) + ). + + client->view_display( tmp->stringify( ) ). + + ENDMETHOD. + + + METHOD z2ui5_if_app~main. + + me->client = client. + + IF check_initialized = abap_false. + check_initialized = abap_true. + favicon = `https://cdn.jsdelivr.net/gh/abap2UI5/abap2UI5/resources/abap2ui5.png`. + + display_view( ). + + ENDIF. + + CASE client->get( )-event. + + WHEN 'SET_VIEW'. + display_view( ). + + 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_cc_sample_favicon.clas.xml b/src/01/z2ui5_cl_cc_sample_favicon.clas.xml new file mode 100644 index 0000000..bd54445 --- /dev/null +++ b/src/01/z2ui5_cl_cc_sample_favicon.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_CC_SAMPLE_FAVICON + E + basic - favicon + 1 + X + X + X + + + +