diff --git a/src/00/z2ui5_cl_app_demo_00.clas.abap b/src/00/z2ui5_cl_app_demo_00.clas.abap index af5b13d8..e53c10ef 100644 --- a/src/00/z2ui5_cl_app_demo_00.clas.abap +++ b/src/00/z2ui5_cl_app_demo_00.clas.abap @@ -41,9 +41,9 @@ CLASS z2ui5_cl_app_demo_00 IMPLEMENTATION. shownavbutton = abap_true )->header_content( )->toolbar_spacer( - )->link( text = 'SCN' href = 'https://blogs.sap.com/tag/abap2ui5/' - )->link( text = 'Twitter' href = 'https://twitter.com/OblomovDev' - )->link( text = 'GitHub' href = 'https://github.com/oblomov-dev/abap2ui5' + )->link( text = 'SCN' target = '_blank' href = 'https://blogs.sap.com/tag/abap2ui5/' + )->link( text = 'Twitter' target = '_blank' href = 'https://twitter.com/OblomovDev' + )->link( text = 'GitHub' target = '_blank' href = 'https://github.com/oblomov-dev/abap2ui5' )->get_parent( ). DATA(grid) = page->grid( 'L3 M6 S12' diff --git a/src/00/z2ui5_cl_app_demo_03.clas.abap b/src/00/z2ui5_cl_app_demo_03.clas.abap index f2d540cb..e37c5b56 100644 --- a/src/00/z2ui5_cl_app_demo_03.clas.abap +++ b/src/00/z2ui5_cl_app_demo_03.clas.abap @@ -47,7 +47,7 @@ CLASS Z2UI5_CL_APP_DEMO_03 IMPLEMENTATION. client->nav_app_leave( client->get_app( client->get( )-id_prev_app_stack ) ). ENDCASE. - DATA(page) = z2ui5_cl_xml_view_helper=>factory( + DATA(page) = z2ui5_cl_xml_view_helper=>factory( )->shell( )->page( title = 'abap2UI5 - List' navbuttonpress = client->_event( 'BACK' ) diff --git a/src/00/z2ui5_cl_app_demo_11.clas.abap b/src/00/z2ui5_cl_app_demo_11.clas.abap index e8cf165c..0102627b 100644 --- a/src/00/z2ui5_cl_app_demo_11.clas.abap +++ b/src/00/z2ui5_cl_app_demo_11.clas.abap @@ -60,7 +60,7 @@ CLASS Z2UI5_CL_APP_DEMO_11 IMPLEMENTATION. ENDCASE. - DATA(page) = z2ui5_cl_xml_view_helper=>factory( + DATA(page) = z2ui5_cl_xml_view_helper=>factory( )->shell( )->page( title = 'abap2UI5 - Tables and editable' navbuttonpress = client->_event( 'BACK' ) diff --git a/src/00/z2ui5_cl_app_demo_12.clas.abap b/src/00/z2ui5_cl_app_demo_12.clas.abap index e89f120e..fa3f8dbe 100644 --- a/src/00/z2ui5_cl_app_demo_12.clas.abap +++ b/src/00/z2ui5_cl_app_demo_12.clas.abap @@ -77,7 +77,7 @@ CLASS Z2UI5_CL_APP_DEMO_12 IMPLEMENTATION. ENDCASE. - DATA(lo_main) = z2ui5_cl_xml_view_helper=>factory( ). + DATA(lo_main) = z2ui5_cl_xml_view_helper=>factory( )->shell( ). CASE mv_main_view. diff --git a/src/00/z2ui5_cl_app_demo_21.clas.abap b/src/00/z2ui5_cl_app_demo_21.clas.abap index b77a8e31..ec645e18 100644 --- a/src/00/z2ui5_cl_app_demo_21.clas.abap +++ b/src/00/z2ui5_cl_app_demo_21.clas.abap @@ -69,7 +69,7 @@ CLASS Z2UI5_CL_APP_DEMO_21 IMPLEMENTATION. METHOD view_main. - DATA(page) = z2ui5_cl_xml_view_helper=>factory( + DATA(page) = z2ui5_cl_xml_view_helper=>factory( )->shell( )->page( title = 'abap2UI5 - Popups' navbuttonpress = client->_event( 'BACK' ) diff --git a/src/00/z2ui5_cl_app_demo_22.clas.abap b/src/00/z2ui5_cl_app_demo_22.clas.abap index e26ae4df..99fc7192 100644 --- a/src/00/z2ui5_cl_app_demo_22.clas.abap +++ b/src/00/z2ui5_cl_app_demo_22.clas.abap @@ -100,7 +100,7 @@ CLASS Z2UI5_CL_APP_DEMO_22 IMPLEMENTATION. ENDCASE. - DATA(view) = z2ui5_cl_xml_view_helper=>factory( ). + DATA(view) = z2ui5_cl_xml_view_helper=>factory( )->shell( ). DATA(page) = view->page( id = 'id_page' title = 'abap2ui5 - Scrolling and Cursor (use the browser Chrome to avoid incompatibilities)' diff --git a/src/00/z2ui5_cl_app_demo_24.clas.abap b/src/00/z2ui5_cl_app_demo_24.clas.abap index f57f7f6a..d6b75dc4 100644 --- a/src/00/z2ui5_cl_app_demo_24.clas.abap +++ b/src/00/z2ui5_cl_app_demo_24.clas.abap @@ -53,7 +53,7 @@ CLASS z2ui5_cl_app_demo_24 IMPLEMENTATION. ENDCASE. - DATA(view) = z2ui5_cl_xml_view_helper=>factory( + DATA(view) = z2ui5_cl_xml_view_helper=>factory( )->shell( )->page( title = 'abap2UI5 - flow logic - APP 01' navbuttonpress = client->_event( 'BACK' ) shownavbutton = abap_true )->header_content( )->link( text = 'Demo' target = '_blank' href = `https://twitter.com/OblomovDev/status/1640743794206228480` diff --git a/src/00/z2ui5_cl_app_demo_25.clas.abap b/src/00/z2ui5_cl_app_demo_25.clas.abap index f427e3ca..4a1328da 100644 --- a/src/00/z2ui5_cl_app_demo_25.clas.abap +++ b/src/00/z2ui5_cl_app_demo_25.clas.abap @@ -64,7 +64,7 @@ CLASS z2ui5_cl_app_demo_25 IMPLEMENTATION. WHEN 'MAIN' OR ''. - DATA(page) = z2ui5_cl_xml_view_helper=>factory( + DATA(page) = z2ui5_cl_xml_view_helper=>factory( )->shell( )->page( title = 'abap2UI5 - flow logic - APP 02' navbuttonpress = client->_event( 'BACK' ) shownavbutton = abap_true diff --git a/src/00/z2ui5_cl_app_demo_26.clas.abap b/src/00/z2ui5_cl_app_demo_26.clas.abap index f4a385a4..8f01291e 100644 --- a/src/00/z2ui5_cl_app_demo_26.clas.abap +++ b/src/00/z2ui5_cl_app_demo_26.clas.abap @@ -98,7 +98,7 @@ CLASS Z2UI5_CL_APP_DEMO_26 IMPLEMENTATION. WHEN 'VIEW_MAIN'. - app-s_next-xml_main = z2ui5_cl_xml_view_helper=>factory( + app-s_next-xml_main = z2ui5_cl_xml_view_helper=>factory( )->shell( )->page( title = 'abap2UI5 - Popover Examples' navbuttonpress = client->_event( 'BACK' ) diff --git a/src/00/z2ui5_cl_app_demo_27.clas.abap b/src/00/z2ui5_cl_app_demo_27.clas.abap index 8066804b..5e2e6a6d 100644 --- a/src/00/z2ui5_cl_app_demo_27.clas.abap +++ b/src/00/z2ui5_cl_app_demo_27.clas.abap @@ -98,7 +98,7 @@ CLASS Z2UI5_CL_APP_DEMO_27 IMPLEMENTATION. METHOD z2ui5_on_render. - app-s_next-xml_main = z2ui5_cl_xml_view_helper=>factory( + app-s_next-xml_main = z2ui5_cl_xml_view_helper=>factory( )->shell( )->page( title = 'abap2UI5 - Binding Syntax' navbuttonpress = client->_event( 'BACK' ) diff --git a/src/00/z2ui5_cl_app_demo_34.clas.abap b/src/00/z2ui5_cl_app_demo_34.clas.abap index 5a97ff11..6bcc815f 100644 --- a/src/00/z2ui5_cl_app_demo_34.clas.abap +++ b/src/00/z2ui5_cl_app_demo_34.clas.abap @@ -27,7 +27,7 @@ CLASS Z2UI5_CL_APP_DEMO_34 IMPLEMENTATION. METHOD view_main. - DATA(page) = z2ui5_cl_xml_view_helper=>factory( + DATA(page) = z2ui5_cl_xml_view_helper=>factory( )->shell( )->page( title = 'abap2UI5 - Popups' navbuttonpress = client->_event( 'BACK' ) diff --git a/src/00/z2ui5_cl_xml_view_helper.clas.abap b/src/00/z2ui5_cl_xml_view_helper.clas.abap index bb29d3a1..7cbb5d26 100644 --- a/src/00/z2ui5_cl_xml_view_helper.clas.abap +++ b/src/00/z2ui5_cl_xml_view_helper.clas.abap @@ -60,7 +60,6 @@ CLASS z2ui5_cl_xml_view_helper DEFINITION RETURNING VALUE(result) TYPE REF TO z2ui5_cl_xml_view_helper. - METHODS Dynamic_Page_Header IMPORTING pinnable TYPE clike OPTIONAL @@ -864,6 +863,27 @@ ENDCLASS. CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION. + METHOD constructor. + + mt_prop = VALUE #( + ( n = `xmlns` v = `sap.m` ) + ( n = `xmlns:z2ui5` v = `z2ui5` ) + ( n = `xmlns:core` v = `sap.ui.core` ) + ( n = `xmlns:mvc` v = `sap.ui.core.mvc` ) + ( n = `xmlns:layout` v = `sap.ui.layout` ) + ( n = `xmlns:f` v = `sap.f` ) + ( n = `xmlns:form` v = `sap.ui.layout.form` ) + ( n = `xmlns:editor` v = `sap.ui.codeeditor` ) + ( n = `xmlns:mchart` v = `sap.suite.ui.microchart` ) + ( n = `xmlns:webc` v = `sap.ui.webc.main` ) + ( n = `xmlns:uxap` v = `sap.uxap` ) + ( n = `xmlns:sap` v = `sap` ) + ( n = `xmlns:text` v = `sap.ui.richtextedito` ) + ( n = `xmlns:html` v = `http://www.w3.org/1999/xhtml` ) + ). + + ENDMETHOD. + METHOD factory. result = NEW #( ). @@ -878,10 +898,9 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION. ( n = 'controllerName' v = 'z2ui5_controller' ) ). - result->m_name = `View`. - result->m_ns = `mvc`. - - result->m_root = result. + result->m_name = `View`. + result->m_ns = `mvc`. + result->m_root = result. result->m_parent = result. ENDMETHOD. @@ -956,8 +975,8 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION. METHOD blocks. result = _generic( - name = `blocks` - ns = `uxap` + name = `blocks` + ns = `uxap` ). ENDMETHOD. @@ -975,7 +994,7 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION. ( n = `enabled` v = _=>get_json_boolean( enabled ) ) ( n = `icon` v = icon ) ( n = `type` v = type ) - ( n = `id` v = id ) + ( n = `id` v = id ) ( n = `class` v = class ) ) ). @@ -1080,7 +1099,7 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION. result = _generic( `customData` - ). + ). ENDMETHOD. @@ -1354,7 +1373,7 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION. ( n = `showClearIcon` v = _=>get_json_boolean( showclearicon ) ) ( n = `description` v = description ) ( n = `editable` v = _=>get_json_boolean( editable ) ) - ( n = `enabled` v = _=>get_json_boolean( enabled ) ) + ( n = `enabled` v = _=>get_json_boolean( enabled ) ) ( n = `valueState` v = valuestate ) ( n = `valueStateText` v = valuestatetext ) ( n = `value` v = value ) @@ -1570,10 +1589,10 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION. _generic( name = `MessageStrip` t_prop = VALUE #( - ( n = `text` v = text ) - ( n = `type` v = type ) + ( n = `text` v = text ) + ( n = `type` v = type ) ( n = `showIcon` v = _=>get_json_boolean( showicon ) ) - ( n = `class` v = class ) + ( n = `class` v = class ) ) ). ENDMETHOD. @@ -1600,10 +1619,10 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION. _generic( name = `ObjectNumber` t_prop = VALUE #( - ( n = `emphasized` v = _=>get_json_boolean( emphasized ) ) - ( n = `number` v = number ) - ( n = `state` v = state ) - ( n = `unit` v = unit ) + ( n = `emphasized` v = _=>get_json_boolean( emphasized ) ) + ( n = `number` v = number ) + ( n = `state` v = state ) + ( n = `unit` v = unit ) ) ). ENDMETHOD. @@ -2221,9 +2240,7 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION. result = _generic( name = `DynamicPageTitle` ns = `f` - t_prop = VALUE #( - " ( n = `pinnable` v = pinnable ) - ) ). + ). ENDMETHOD. @@ -2233,7 +2250,6 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION. _generic( name = `ObjectAttribute` - " ns = `form` t_prop = VALUE #( ( n = `title` v = title ) ( n = `text` v = text ) @@ -2265,17 +2281,14 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION. DATA(lv_url) = get-t_req_header[ name = `referer` ]-value. SPLIT lv_url AT '?' INTO lv_url DATA(lv_dummy). - " result-url_app = lv_url && `?sap-client=` && sy-mandt && `&app=` && _=>get_classname_by_ref( mo_runtime->ms_db-o_app ). result = z2ui5_cl_http_handler=>client-t_header[ name = `origin` ]-value && `/sap/bc/adt/oo/classes/` && _=>get_classname_by_ref( app ) && `/source/main`. - ENDMETHOD. METHOD additional_content. result = _generic( name = `additionalContent` - ). ENDMETHOD. @@ -2299,39 +2312,11 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION. result->mt_prop = t_ns. ENDIF. - " result->mt_prop = VALUE #( BASE result->mt_prop - " ( n = 'displayBlock' v = 'true' ) - " ( n = 'height' v = '100%' ) - " ( n = 'controllerName' v = 'z2ui5_controller' ) - " ). - result->m_name = `FragmentDefinition`. result->m_ns = `core`. - result->m_root = result. result->m_parent = result. ENDMETHOD. - METHOD constructor. - - mt_prop = VALUE #( - ( n = `xmlns` v = `sap.m` ) - ( n = `xmlns:z2ui5` v = `z2ui5` ) - ( n = `xmlns:core` v = `sap.ui.core` ) - ( n = `xmlns:mvc` v = `sap.ui.core.mvc` ) - ( n = `xmlns:layout` v = `sap.ui.layout` ) - ( n = `xmlns:f` v = `sap.f` ) - ( n = `xmlns:form` v = `sap.ui.layout.form` ) - ( n = `xmlns:editor` v = `sap.ui.codeeditor` ) - ( n = `xmlns:mchart` v = `sap.suite.ui.microchart` ) - ( n = `xmlns:webc` v = `sap.ui.webc.main` ) - ( n = `xmlns:uxap` v = `sap.uxap` ) - ( n = `xmlns:sap` v = `sap` ) - ( n = `xmlns:text` v = `sap.ui.richtextedito` ) - ( n = `xmlns:html` v = `http://www.w3.org/1999/xhtml` ) - ). - - ENDMETHOD. - ENDCLASS. diff --git a/src/z2ui5_cl_http_handler.clas.abap b/src/z2ui5_cl_http_handler.clas.abap index 02053daa..2098807a 100644 --- a/src/z2ui5_cl_http_handler.clas.abap +++ b/src/z2ui5_cl_http_handler.clas.abap @@ -88,17 +88,18 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION. ` ` && ` ` && |\n| && - `
` && |\n| && - ` ` && |\n| && - `` && |\n| && - `