diff --git a/src/00/z2ui5_cl_app_demo_00.clas.abap b/src/00/z2ui5_cl_app_demo_00.clas.abap index c846d995..0f65bb71 100644 --- a/src/00/z2ui5_cl_app_demo_00.clas.abap +++ b/src/00/z2ui5_cl_app_demo_00.clas.abap @@ -79,28 +79,34 @@ CLASS z2ui5_cl_app_demo_00 IMPLEMENTATION. )->button( text = 'Popups & Flow Logic' press = client->_event( 'z2ui5_cl_app_demo_12' ) )->button( text = 'Popover' press = client->_event( 'z2ui5_cl_app_demo_26' ) ). -* + + grid->simple_form( title = 'HowTo - Messages' layout = 'ResponsiveGridLayout' )->content( 'form' + )->button( text = 'Toast, Box & Strip' press = client->_event( 'z2ui5_cl_app_demo_08' ) + )->button( text = 'Illustrated Message' press = client->_event( 'z2ui5_cl_app_demo_33' ) + )->button( text = 'T100 & bapiret popup' press = client->_event( 'z2ui5_cl_app_demo_34' ) + )->button( text = 'Message Manager' press = client->_event( 'z2ui5_cl_app_demo_38' ) + ). + grid->simple_form( title = 'HowTo - Layouts' layout = 'ResponsiveGridLayout' )->content( 'form' )->button( text = 'Layout (Header, Footer, Grid)' press = client->_event( 'z2ui5_cl_app_demo_10' ) )->button( text = 'Object Page' press = client->_event( 'z2ui5_cl_app_demo_17' ) )->button( text = 'Dynamic Page' press = client->_event( 'z2ui5_cl_app_demo_30' ) * )->button( text = 'Split App' press = client->_event( 'z2ui5_cl_app_demo_17' ) ). -* - grid->simple_form( title = 'HowTo - Extensions' layout = 'ResponsiveGridLayout' )->content( 'form' + + grid->simple_form( title = 'HowTo - Extension II' layout = 'ResponsiveGridLayout' )->content( 'form' )->button( text = 'Views - Normal, Generic, XML' press = client->_event( 'z2ui5_cl_app_demo_23' ) )->button( text = 'Import UI5-XML-View' press = client->_event( 'z2ui5_cl_app_demo_31' ) - )->button( text = 'HTML, JS, CSS' press = client->_event( 'z2ui5_cl_app_demo_32 ' ) )->button( text = 'Custom Control' press = client->_event( 'z2ui5_cl_app_demo_37' ) ). - grid->simple_form( title = 'HowTo - Messages' layout = 'ResponsiveGridLayout' )->content( 'form' - )->button( text = 'Toast, Box & Strip' press = client->_event( 'z2ui5_cl_app_demo_08' ) - )->button( text = 'Illustrated Message' press = client->_event( 'z2ui5_cl_app_demo_33' ) - )->button( text = 'T100 & bapiret popup' press = client->_event( 'z2ui5_cl_app_demo_34' ) - )->button( text = 'Message Manager' press = client->_event( 'z2ui5_cl_app_demo_38' ) + grid->simple_form( title = 'HowTo - Extension II' layout = 'ResponsiveGridLayout' )->content( 'form' + )->button( text = 'HTML, JS, CSS' press = client->_event( 'z2ui5_cl_app_demo_32' ) + )->button( text = 'Canvas & SVG' press = client->_event( 'z2ui5_cl_app_demo_36' ) + )->button( text = 'ext. Library' press = client->_event( 'z2ui5_cl_app_demo_40' ) ). + DATA(form) = page->grid( 'L9 M12 S12' )->content( 'layout' )->simple_form( 'Demos I' diff --git a/src/00/z2ui5_cl_app_demo_23.clas.abap b/src/00/z2ui5_cl_app_demo_23.clas.abap index 8d9059d2..242c4029 100644 --- a/src/00/z2ui5_cl_app_demo_23.clas.abap +++ b/src/00/z2ui5_cl_app_demo_23.clas.abap @@ -97,7 +97,7 @@ CLASS z2ui5_cl_app_demo_23 IMPLEMENTATION. ` > ty_s_get, - next TYPE z2ui5_if_client=>ty_s_next, - END OF app. - - METHODS z2ui5_on_init. - METHODS z2ui5_on_event. - METHODS z2ui5_on_render. - - PRIVATE SECTION. -ENDCLASS. - - - -CLASS Z2UI5_CL_APP_DEMO_29 IMPLEMENTATION. - - - METHOD z2ui5_if_app~controller. - - me->client = client. - app-get = client->get( ). - app-view_popup = ``. - - IF app-check_initialized = abap_false. - app-check_initialized = abap_true. - z2ui5_on_init( ). - ENDIF. - - IF app-get-event IS NOT INITIAL. - z2ui5_on_event( ). - ENDIF. - - z2ui5_on_render( ). - - client->set_next( app-next ). - CLEAR app-get. - CLEAR app-next. - - ENDMETHOD. - - - METHOD z2ui5_on_event. - - CASE app-get-event. - - WHEN 'POST'. - client->popup_message_toast( app-get-event_data ). - - WHEN 'MYCC'. - client->popup_message_toast( 'MYCC event ' && mv_value ). - - WHEN 'BACK'. - client->nav_app_leave( client->get_app( app-get-id_prev_app_stack ) ). - - ENDCASE. - - ENDMETHOD. - - - METHOD z2ui5_on_init. - - product = 'tomato'. - quantity = '500'. - app-view_main = 'VIEW_MAIN'. - input41 = 'faasdfdfsaVIp'. - - input21 = '40'. - input22 = '40'. - - mv_value = 'test'. - - ENDMETHOD. - - - METHOD z2ui5_on_render. - - - app-next-xml_main = ` ` && |\n| && - ` ` && |\n| && - `` && - `` && |\n| && - `` && |\n| && - `

This is a heading with css

` && |\n| && - `

This is a paragraph with css.

` && |\n| && - `

My First JavaScript

` && |\n| && - `` && |\n| && - `` && |\n| && - `

This is SVG

` && |\n| && - ` ` && |\n| && - ` ` && |\n| && - ` ` && |\n| && - `
X:

This is canvas

` && |\n| && - `` && |\n| && - ` ` && |\n| && - `
`. - - - - ENDMETHOD. -ENDCLASS. diff --git a/src/00/z2ui5_cl_app_demo_31.clas.abap b/src/00/z2ui5_cl_app_demo_31.clas.abap index edd6220b..53f0488d 100644 --- a/src/00/z2ui5_cl_app_demo_31.clas.abap +++ b/src/00/z2ui5_cl_app_demo_31.clas.abap @@ -14,6 +14,7 @@ CLASS z2ui5_cl_app_demo_31 DEFINITION PUBLIC. check_initialized TYPE abap_bool, get TYPE z2ui5_if_client=>ty_s_get, next TYPE z2ui5_if_client=>ty_s_next, + popup type string, END OF app. METHODS z2ui5_on_init. @@ -33,6 +34,7 @@ CLASS z2ui5_cl_app_demo_31 IMPLEMENTATION. app-get = client->get( ). me->client = client. + app-popup = ``. IF app-check_initialized = abap_false. app-check_initialized = abap_true. @@ -60,8 +62,9 @@ CLASS z2ui5_cl_app_demo_31 IMPLEMENTATION. WHEN 'BACK'. client->nav_app_leave( client->get_app( app-get-id_prev_app_stack ) ). WHEN 'POPUP'. + app-popup = 'TEST'. + WHEN 'DATA'. client->popup_message_box( 'Event raised value:' && mv_value ). - ENDCASE. ENDMETHOD. @@ -93,8 +96,8 @@ CLASS z2ui5_cl_app_demo_31 IMPLEMENTATION. ` ` && |\n| && ` ` && |\n| && |\n| && - ` ` && |\n| && + ` ` && |\n| && ` ` && |\n| && ` ` && |\n| && |\n| && @@ -164,6 +167,7 @@ CLASS z2ui5_cl_app_demo_31 IMPLEMENTATION. METHOD z2ui5_on_render_popup. + if app-popup = `TEST`. app-next-xml_popup = `` && |\n| && @@ -205,6 +209,7 @@ CLASS z2ui5_cl_app_demo_31 IMPLEMENTATION. ` ` && |\n| && ``. + endif. ENDMETHOD. ENDCLASS. diff --git a/src/00/z2ui5_cl_app_demo_32.clas.abap b/src/00/z2ui5_cl_app_demo_32.clas.abap index 3ccd78c7..33f0e2ad 100644 --- a/src/00/z2ui5_cl_app_demo_32.clas.abap +++ b/src/00/z2ui5_cl_app_demo_32.clas.abap @@ -94,30 +94,6 @@ CLASS Z2UI5_CL_APP_DEMO_32 IMPLEMENTATION. METHOD z2ui5_on_render. -* app-next-xml_main = ` ` && |\n| && -* ` ` && |\n| && -* `` && -* `` && |\n| && -* `` && |\n| && -* `

This is a heading with css

` && |\n| && -* `

This is a paragraph with css.

` && |\n| && -* `

My First JavaScript

` && |\n| && -* `` && |\n| && -* ` ` && -* `` && |\n| && -* ` ` && |\n| && -* `
`. - app-next-xml_main = ` Z2UI5_CL_APP_DEMO_32 E - extension - html examples + extension - html css js 1 X X diff --git a/src/00/z2ui5_cl_app_demo_36.clas.xml b/src/00/z2ui5_cl_app_demo_36.clas.xml index a6053370..65a51098 100644 --- a/src/00/z2ui5_cl_app_demo_36.clas.xml +++ b/src/00/z2ui5_cl_app_demo_36.clas.xml @@ -5,7 +5,7 @@ Z2UI5_CL_APP_DEMO_36 E - extension - html js 2 + extension - canvas and svg 1 X X diff --git a/src/00/z2ui5_cl_app_demo_37.clas.abap b/src/00/z2ui5_cl_app_demo_37.clas.abap index e10f39b8..33b24dc1 100644 --- a/src/00/z2ui5_cl_app_demo_37.clas.abap +++ b/src/00/z2ui5_cl_app_demo_37.clas.abap @@ -4,25 +4,27 @@ CLASS z2ui5_cl_app_demo_37 DEFINITION PUBLIC. INTERFACES z2ui5_if_app. - data mv_value type string. - DATA product TYPE string. - DATA quantity TYPE i. + DATA mv_value TYPE string. - DATA input21 TYPE string. - DATA input22 TYPE string. - DATA input41 TYPE string. PROTECTED SECTION. - data client TYPE REF TO z2ui5_if_client. + DATA client TYPE REF TO z2ui5_if_client. DATA: BEGIN OF app, check_initialized TYPE abap_bool, view_main TYPE string, view_popup TYPE string, - get TYPE z2ui5_if_client=>ty_s_get, - next TYPE z2ui5_if_client=>ty_s_next, + get TYPE z2ui5_if_client=>ty_s_get, + next TYPE z2ui5_if_client=>ty_s_next, END OF app. + DATA mv_load_cc TYPE abap_bool. + DATA mv_display_cc TYPE abap_bool. + + METHODS get_js_custom_control + RETURNING + VALUE(result) TYPE string. + METHODS z2ui5_on_init. METHODS z2ui5_on_event. METHODS z2ui5_on_render. @@ -32,7 +34,7 @@ ENDCLASS. -CLASS Z2UI5_CL_APP_DEMO_37 IMPLEMENTATION. +CLASS z2ui5_cl_app_demo_37 IMPLEMENTATION. METHOD z2ui5_if_app~controller. @@ -66,8 +68,16 @@ CLASS Z2UI5_CL_APP_DEMO_37 IMPLEMENTATION. WHEN 'POST'. client->popup_message_toast( app-get-event_data ). - WHEN 'MYCC'. - client->popup_message_toast( 'MYCC event ' && mv_value ). + WHEN 'LOAD_CC'. + mv_load_cc = abap_true. + client->popup_message_box( 'Custom Control loaded ' ). + + WHEN 'DISPLAY_CC'. + mv_display_cc = abap_true. + client->popup_message_box( 'Custom Control displayed ' ). + + WHEN 'MYCC'. + client->popup_message_toast( `Custom Control input: ` && mv_value ). WHEN 'BACK'. client->nav_app_leave( client->get_app( app-get-id_prev_app_stack ) ). @@ -79,16 +89,6 @@ CLASS Z2UI5_CL_APP_DEMO_37 IMPLEMENTATION. METHOD z2ui5_on_init. - product = 'tomato'. - quantity = '500'. - app-view_main = 'VIEW_MAIN'. - input41 = 'faasdfdfsaVIp'. - - input21 = '40'. - input22 = '40'. - - mv_value = 'test'. - ENDMETHOD. @@ -102,96 +102,66 @@ CLASS Z2UI5_CL_APP_DEMO_37 IMPLEMENTATION. ` press="` && client->_event( 'BACK' ) && `" ` && |\n| && ` class="sapUiContentPadding sapUiResponsivePadding--content"/> ` && |\n| && ` ` && |\n| && - `` && + `` && |\n| && + `` && |\n| && + ` ` && `` && |\n| && - `` && |\n| && - `` && |\n| && - |\n| && - `

This is a heading with css

` && |\n| && - `

This is a paragraph with css.

` && |\n| && - `

My First JavaScript

` && |\n| && - `` && |\n| && - `` && |\n| && - `

This is SVG

` && |\n| && - ` ` && |\n| && - ` ` && |\n| && - ` ` && |\n| && - `
X:

This is canvas

` && |\n| && - ` ` && -* ` ` && |\n| && + ``. - `` && |\n| && - ` ` && |\n| && - `
`. + IF mv_load_cc = abap_true. + mv_load_cc = abap_false. + app-next-xml_main = app-next-xml_main && get_js_custom_control( ). + ENDIF. + + IF mv_display_cc = abap_true. + app-next-xml_main = app-next-xml_main && ` `. + ENDIF. + + app-next-xml_main = app-next-xml_main && `` && |\n| && + ` ` && |\n| && + ``. + ENDMETHOD. + + METHOD get_js_custom_control. + + result = ``. + ENDMETHOD. ENDCLASS. diff --git a/src/00/z2ui5_cl_app_demo_39.clas.abap b/src/00/z2ui5_cl_app_demo_39.clas.abap new file mode 100644 index 00000000..33577b99 --- /dev/null +++ b/src/00/z2ui5_cl_app_demo_39.clas.abap @@ -0,0 +1,208 @@ +CLASS z2ui5_cl_app_demo_39 DEFINITION PUBLIC. + + PUBLIC SECTION. + + INTERFACES z2ui5_if_app. + + DATA mv_value TYPE string. + + PROTECTED SECTION. + + DATA client TYPE REF TO z2ui5_if_client. + DATA: + BEGIN OF app, + check_initialized TYPE abap_bool, + get TYPE z2ui5_if_client=>ty_s_get, + next TYPE z2ui5_if_client=>ty_s_next, + END OF app. + + METHODS z2ui5_on_init. + METHODS z2ui5_on_event. + METHODS z2ui5_on_render_main. + METHODS z2ui5_on_render_popup. + + PRIVATE SECTION. +ENDCLASS. + + + +CLASS z2ui5_cl_app_demo_39 IMPLEMENTATION. + + + METHOD z2ui5_if_app~controller. + + app-get = client->get( ). + me->client = client. + + IF app-check_initialized = abap_false. + app-check_initialized = abap_true. + z2ui5_on_init( ). + ENDIF. + + IF app-get-event IS NOT INITIAL. + z2ui5_on_event( ). + ENDIF. + + z2ui5_on_render_main( ). + z2ui5_on_render_popup( ). + + client->set_next( app-next ). + CLEAR app-get. + CLEAR app-next. + + ENDMETHOD. + + + METHOD z2ui5_on_event. + + CASE app-get-event. + + WHEN 'BACK'. + client->nav_app_leave( client->get_app( app-get-id_prev_app_stack ) ). + WHEN 'POPUP'. + client->popup_message_box( 'Event raised value:' && mv_value ). + + ENDCASE. + + ENDMETHOD. + + + METHOD z2ui5_on_init. + + mv_value = '200'. + + ENDMETHOD. + + + METHOD z2ui5_on_render_main. + + app-next-xml_main = `` && |\n| && + ` ` && |\n| && + `