bugfixes and view separation (#149)

* view logic

* view updates

* bugfix

* abaplint fixes

* abaplint fixes
This commit is contained in:
oblomov 2023-04-10 15:06:47 +02:00
parent 90fce43ca8
commit d329bf527c
30 changed files with 151 additions and 135 deletions

View File

@ -32,7 +32,7 @@ CLASS z2ui5_cl_app_demo_01 IMPLEMENTATION.
client->nav_app_leave( client->get_app( client->get( )-id_prev_app_stack ) ).
ENDCASE.
client->set_next( VALUE #( xml_main = z2ui5_cl_xml_view_helper=>factory(
client->set_next( VALUE #( xml_main = z2ui5_cl_xml_view_helper=>factory( )->shell(
)->page(
title = 'abap2UI5 - First Example'
navbuttonpress = client->_event( 'BACK' )
@ -40,7 +40,7 @@ CLASS z2ui5_cl_app_demo_01 IMPLEMENTATION.
)->header_content(
)->link(
text = 'Source_Code'
href = client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent(
)->simple_form( title = 'Form Title' editable = abap_true
)->content( 'form'

View File

@ -116,7 +116,7 @@ CLASS Z2UI5_CL_APP_DEMO_02 IMPLEMENTATION.
shownavbutton = abap_true
)->header_content(
)->link( text = 'Demo' href = `https://twitter.com/OblomovDev/status/1628701535222865922`
)->link( text = 'Source_Code' href = client->get( )-url_source_code
)->link( text = 'Source_Code' href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
DATA(grid) = page->grid( 'L6 M12 S12'

View File

@ -55,7 +55,7 @@ CLASS Z2UI5_CL_APP_DEMO_03 IMPLEMENTATION.
)->header_content(
)->link(
text = 'Source_Code'
href = client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
page->list(

View File

@ -85,7 +85,7 @@ CLASS Z2UI5_CL_APP_DEMO_04 IMPLEMENTATION.
)->header_content(
)->link(
text = 'Source_Code'
href = client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
page->grid( 'L6 M12 S12' )->content( 'l'

View File

@ -92,7 +92,7 @@ CLASS Z2UI5_CL_APP_DEMO_05 IMPLEMENTATION.
)->header_content(
)->link(
text = 'Source_Code'
href = client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
page->generic_tag(

View File

@ -81,7 +81,7 @@ CLASS Z2UI5_CL_APP_DEMO_06 IMPLEMENTATION.
)->header_content(
)->link(
text = 'Source_Code'
href = client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
page->simple_form( title = 'Form Title' editable = abap_true

View File

@ -169,7 +169,7 @@ CLASS z2ui5_cl_app_demo_07 IMPLEMENTATION.
)->header_content( ns = 'm'
)->toolbar_spacer( ns = 'm'
)->link( ns = 'm' text = 'Demo' href = 'https://twitter.com/OblomovDev/status/1638487600930357248'
)->link( ns = 'm' text = 'Source_Code' href = client->get( )-url_source_code
)->link( ns = 'm' text = 'Source_Code' href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
page->text( ns = 'm' text = 'Custom Control for File Upload is now loaded.'
@ -191,7 +191,7 @@ CLASS z2ui5_cl_app_demo_07 IMPLEMENTATION.
)->header_content(
)->toolbar_spacer(
)->link( text = 'Demo' href = 'https://twitter.com/OblomovDev/status/1638487600930357248'
)->link( text = 'Source_Code' href = client->get( )-url_source_code
)->link( text = 'Source_Code' href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
page->zz_file_uploader(

View File

@ -60,7 +60,7 @@ CLASS Z2UI5_CL_APP_DEMO_08 IMPLEMENTATION.
)->header_content(
)->link(
text = 'Source_Code'
href = client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
IF check_strip_active = abap_true.

View File

@ -218,7 +218,7 @@ CLASS Z2UI5_CL_APP_DEMO_09 IMPLEMENTATION.
href = 'https://twitter.com/OblomovDev/status/1637470531136921600'
)->link(
text = 'Source_Code'
href = client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
DATA(form) = page->grid( 'L7 M7 S7'

View File

@ -35,7 +35,8 @@ CLASS Z2UI5_CL_APP_DEMO_10 IMPLEMENTATION.
href = 'https://twitter.com/OblomovDev'
)->link(
text = 'Source_Code'
href = client->get( )-url_source_code ).
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
).
page->sub_header(
)->overflow_toolbar(

View File

@ -71,7 +71,7 @@ CLASS Z2UI5_CL_APP_DEMO_11 IMPLEMENTATION.
href = 'https://twitter.com/OblomovDev/status/1630240894581608448'
)->link(
text = 'Source_Code'
href = client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
DATA(tab) = page->table(

View File

@ -90,7 +90,7 @@ CLASS Z2UI5_CL_APP_DEMO_12 IMPLEMENTATION.
)->header_content(
)->link(
text = 'Source_Code'
href = client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
DATA(grid) = page->grid( 'L7 M12 S12' )->content( 'l'

View File

@ -170,7 +170,7 @@ CLASS Z2UI5_CL_APP_DEMO_13 IMPLEMENTATION.
href = `https://twitter.com/OblomovDev/status/1634206964291911682`
)->link(
text = 'Source_Code'
href = client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent(
)->sub_header(
)->overflow_toolbar(
@ -258,7 +258,7 @@ CLASS Z2UI5_CL_APP_DEMO_13 IMPLEMENTATION.
href = `https://twitter.com/OblomovDev/status/1634206964291911682`
)->link(
text = 'Source_Code'
href = client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent(
)->sub_header(
)->overflow_toolbar(
@ -322,7 +322,7 @@ CLASS Z2UI5_CL_APP_DEMO_13 IMPLEMENTATION.
href = `https://twitter.com/OblomovDev/status/1634206964291911682`
)->link(
text = 'Source_Code'
href = client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent(
)->sub_header(
)->overflow_toolbar(

View File

@ -57,7 +57,7 @@ CLASS Z2UI5_CL_APP_DEMO_14 IMPLEMENTATION.
shownavbutton = abap_true
)->header_content(
)->link( text = 'Demo' href = 'https://twitter.com/OblomovDev/status/1631562906570575875'
)->link( text = 'Source_Code' href = client->get( )-url_source_code
)->link( text = 'Source_Code' href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
DATA(grid) = page->grid( 'L7 M12 S12' )->content( 'l' ).

View File

@ -40,7 +40,7 @@ CLASS Z2UI5_CL_APP_DEMO_15 IMPLEMENTATION.
shownavbutton = abap_true
)->header_content(
)->toolbar_spacer(
)->link( text = 'Source_Code' href = client->get( )-url_source_code
)->link( text = 'Source_Code' href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent(
)->vbox( 'sapUiSmallMargin'
)->link(

View File

@ -371,7 +371,7 @@ CLASS Z2UI5_CL_APP_DEMO_16 IMPLEMENTATION.
shownavbutton = abap_true
)->header_content(
)->link( text = 'Demo' href = `https://twitter.com/OblomovDev/status/1639191954285113344`
)->link( text = 'Source_Code' href = client->get( )-url_source_code
)->link( text = 'Source_Code' href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent(
)->tab_container( ).

View File

@ -132,7 +132,7 @@ CLASS z2ui5_cl_app_demo_18 IMPLEMENTATION.
)->header_content(
)->link(
text = 'Source_Code'
href = client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent(
)->simple_form( title = 'VIEW_MAIN' editable = abap_true
)->content( 'form'
@ -172,7 +172,7 @@ CLASS z2ui5_cl_app_demo_18 IMPLEMENTATION.
)->header_content(
)->link(
text = 'Source_Code'
href = client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent(
)->simple_form( 'VIEW_SECOND'
)->content( 'form'

View File

@ -65,7 +65,7 @@ CLASS Z2UI5_CL_APP_DEMO_19 IMPLEMENTATION.
href = 'https://twitter.com/OblomovDev/status/1637852441671528448'
)->link(
text = 'Source_Code'
href = client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
page->segmented_button(

View File

@ -83,7 +83,7 @@ CLASS Z2UI5_CL_APP_DEMO_21 IMPLEMENTATION.
text = 'Demo'
href = 'https://twitter.com/OblomovDev/status/1637163852264624139'
)->link(
text = 'Source_Code' href = client->get( )-url_source_code
text = 'Source_Code' href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
DATA(grid) = page->grid( 'L8 M12 S12' )->content( 'l' ).

View File

@ -108,7 +108,7 @@ CLASS Z2UI5_CL_APP_DEMO_22 IMPLEMENTATION.
shownavbutton = abap_true
).
page->header_content( )->link( text = 'Source_Code' href = client->get( )-url_source_code ).
page->header_content( )->link( text = 'Source_Code' href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) ) ).
page->input(

View File

@ -7,9 +7,9 @@ CLASS z2ui5_cl_app_demo_23 DEFINITION PUBLIC.
DATA product TYPE string.
DATA quantity TYPE string.
data client type ref to z2ui5_if_client.
DATA:
BEGIN OF app,
client TYPE REF TO z2ui5_if_client,
check_initialized TYPE abap_bool,
view_main TYPE string,
view_popup TYPE string,
@ -33,7 +33,7 @@ CLASS Z2UI5_CL_APP_DEMO_23 IMPLEMENTATION.
METHOD z2ui5_if_app~controller.
app-client = client.
me->client = client.
app-s_get = client->get( ).
" app-view_popup = ``.
@ -61,7 +61,7 @@ CLASS Z2UI5_CL_APP_DEMO_23 IMPLEMENTATION.
CASE app-s_get-event.
WHEN 'BACK'.
app-client->nav_app_leave( app-client->get_app( app-s_get-id_prev_app_stack ) ).
client->nav_app_leave( client->get_app( app-s_get-id_prev_app_stack ) ).
WHEN OTHERS.
app-view_main = app-s_get-event.
@ -105,15 +105,15 @@ CLASS Z2UI5_CL_APP_DEMO_23 IMPLEMENTATION.
` /> <Label ` && |\n| &&
` text="quantity" ` && |\n| &&
` /> <Input ` && |\n| &&
` value="` && app-client->_bind( quantity ) && `" ` && |\n| &&
` value="` && client->_bind( quantity ) && `" ` && |\n| &&
` /> <Button ` && |\n| &&
` press="` && app-client->_event( 'NORMAL' ) && `"` && |\n| &&
` press="` && client->_event( 'NORMAL' ) && `"` && |\n| &&
` text="NORMAL" ` && |\n| &&
` /> <Button ` && |\n| &&
` press="` && app-client->_event( 'GENERIC' ) && `"` && |\n| &&
` press="` && client->_event( 'GENERIC' ) && `"` && |\n| &&
` text="GENERIC" ` && |\n| &&
` /> <Button ` && |\n| &&
` press="` && app-client->_event( 'XML' ) && `"` && |\n| &&
` press="` && client->_event( 'XML' ) && `"` && |\n| &&
` text="XML" ` && |\n| &&
` /></f:content></f:SimpleForm></Page></Shell></mvc:View>`.
@ -123,27 +123,27 @@ CLASS Z2UI5_CL_APP_DEMO_23 IMPLEMENTATION.
app-s_next-xml_main = z2ui5_cl_xml_view_helper=>factory(
)->page(
title = 'abap2UI5 - NORMAL NORMAL NORMAL'
navbuttonpress = app-client->_event( 'BACK' )
navbuttonpress = client->_event( 'BACK' )
shownavbutton = abap_true
)->header_content(
)->link(
text = 'Source_Code'
href = app-client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent(
)->simple_form( 'Form Title'
)->content( 'form'
)->title( 'Input'
)->label( 'quantity'
)->input( app-client->_bind( quantity )
)->input( client->_bind( quantity )
)->button(
text = 'NORMAL'
press = app-client->_event( 'NORMAL' )
press = client->_event( 'NORMAL' )
)->button(
text = 'GENERIC'
press = app-client->_event( 'GENERIC' )
press = client->_event( 'GENERIC' )
)->button(
text = 'XML'
press = app-client->_event( 'XML' )
press = client->_event( 'XML' )
)->get_root( )->xml_get( ).
@ -156,7 +156,7 @@ CLASS Z2UI5_CL_APP_DEMO_23 IMPLEMENTATION.
t_prop = VALUE #(
( n = `title` v = 'abap2UI5 - GENERIC GENERIC GENERIC' )
( n = `showNavButton` v = `true` )
( n = `navButtonPress` v = app-client->_event( 'BACK' ) )
( n = `navButtonPress` v = client->_event( 'BACK' ) )
) )->_generic(
name = `SimpleForm`
ns = `form`
@ -172,25 +172,25 @@ CLASS Z2UI5_CL_APP_DEMO_23 IMPLEMENTATION.
) )->get_parent( )->_generic(
name = `Input`
t_prop = VALUE #(
( n = `value` v = app-client->_bind( quantity ) )
( n = `value` v = client->_bind( quantity ) )
) )->get_parent(
)->_generic(
name = `Button`
t_prop = VALUE #(
( n = `text` v = `NORMAL` )
( n = `press` v = app-client->_event( 'NORMAL' ) ) )
( n = `press` v = client->_event( 'NORMAL' ) ) )
)->get_parent(
)->_generic(
name = `Button`
t_prop = VALUE #(
( n = `text` v = `GENERIC` )
( n = `press` v = app-client->_event( 'GENERIC' ) ) )
( n = `press` v = client->_event( 'GENERIC' ) ) )
)->get_parent(
)->_generic(
name = `Button`
t_prop = VALUE #(
( n = `text` v = `XML` )
( n = `press` v = app-client->_event( 'XML' ) ) )
( n = `press` v = client->_event( 'XML' ) ) )
).
app-s_next-xml_main = li_view->get_root( )->xml_get( ).

View File

@ -57,7 +57,7 @@ CLASS z2ui5_cl_app_demo_24 IMPLEMENTATION.
)->page( title = 'abap2UI5 - flow logic - APP 01' navbuttonpress = client->_event( 'BACK' ) shownavbutton = abap_true
)->header_content(
)->link( text = 'Demo' href = `https://twitter.com/OblomovDev/status/1640743794206228480`
)->link( text = 'Source_Code' href = client->get( )-url_source_code
)->link( text = 'Source_Code' href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent(
)->grid( 'L6 M12 S12' )->content( 'l'

View File

@ -71,7 +71,7 @@ CLASS z2ui5_cl_app_demo_25 IMPLEMENTATION.
navbuttonpress = client->_event( 'BACK' ) shownavbutton = abap_true
)->header_content(
)->link( text = 'Demo' href = `https://twitter.com/OblomovDev/status/1640743794206228480`
)->link( text = 'Source_Code' href = client->get( )-url_source_code
)->link( text = 'Source_Code' href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
page->grid( 'L6 M12 S12' )->content( 'l'
@ -97,7 +97,7 @@ CLASS z2ui5_cl_app_demo_25 IMPLEMENTATION.
navbuttonpress = client->_event( 'BACK' ) shownavbutton = abap_true
)->header_content(
)->link( text = 'Demo' href = `https://twitter.com/OblomovDev/status/1640743794206228480`
)->link( text = 'Source_Code' href = client->get( )-url_source_code
)->link( text = 'Source_Code' href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
page->grid( 'L6 M12 S12' )->content( 'l'

View File

@ -10,9 +10,9 @@ CLASS z2ui5_cl_app_demo_26 DEFINITION PUBLIC.
PROTECTED SECTION.
data client TYPE REF TO z2ui5_if_client.
DATA:
BEGIN OF app,
client TYPE REF TO z2ui5_if_client,
check_initialized TYPE abap_bool,
view_main TYPE string,
view_popup TYPE string,
@ -35,7 +35,7 @@ CLASS Z2UI5_CL_APP_DEMO_26 IMPLEMENTATION.
METHOD z2ui5_if_app~controller.
app-client = client.
me->client = client.
app-s_get = client->get( ).
app-view_popup = ``.
@ -77,15 +77,15 @@ CLASS Z2UI5_CL_APP_DEMO_26 IMPLEMENTATION.
app-s_next-popup_open_by_id = 'TEST'.
WHEN 'BUTTON_CONFIRM'.
app-client->popup_message_toast( |confirm| ).
client->popup_message_toast( |confirm| ).
app-view_popup = ''.
WHEN 'BUTTON_CANCEL'.
app-client->popup_message_toast( |cancel| ).
client->popup_message_toast( |cancel| ).
app-view_popup = ''.
WHEN 'BACK'.
app-client->nav_app_leave( app-client->get_app( app-s_get-id_prev_app_stack ) ).
client->nav_app_leave( client->get_app( app-s_get-id_prev_app_stack ) ).
ENDCASE.
@ -101,12 +101,12 @@ CLASS Z2UI5_CL_APP_DEMO_26 IMPLEMENTATION.
app-s_next-xml_main = z2ui5_cl_xml_view_helper=>factory(
)->page(
title = 'abap2UI5 - Popover Examples'
navbuttonpress = app-client->_event( 'BACK' )
navbuttonpress = client->_event( 'BACK' )
shownavbutton = abap_true
)->header_content(
)->link(
text = 'Source_Code'
href = app-client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent(
)->simple_form( 'Popover'
)->content( 'form'
@ -114,7 +114,7 @@ CLASS Z2UI5_CL_APP_DEMO_26 IMPLEMENTATION.
)->label( 'Link'
)->link( text = 'Documentation UI5 Popover Control' href = 'https://openui5.hana.ondemand.com/entity/sap.m.Popover'
)->label( 'placement'
)->segmented_button( app-client->_bind( mv_placement )
)->segmented_button( client->_bind( mv_placement )
)->items(
)->segmented_button_item(
key = 'Left'
@ -136,14 +136,14 @@ CLASS Z2UI5_CL_APP_DEMO_26 IMPLEMENTATION.
)->label( 'popover'
)->button(
text = 'show'
press = app-client->_event( 'POPOVER' )
press = client->_event( 'POPOVER' )
id = 'TEST'
)->button(
text = 'cancel'
press = app-client->_event( 'POPOVER' )
press = client->_event( 'POPOVER' )
)->button(
text = 'post'
press = app-client->_event( 'POPOVER' )
press = client->_event( 'POPOVER' )
)->get_root( )->xml_get( ).
@ -165,15 +165,14 @@ CLASS Z2UI5_CL_APP_DEMO_26 IMPLEMENTATION.
app-s_next-xml_popup = z2ui5_cl_xml_view_helper=>factory( )->popover(
title = 'Popover Title'
placement = mv_placement
" icon = 'sap-icon://edit'
)->footer( )->overflow_toolbar(
)->toolbar_spacer(
)->button(
text = 'Cancel'
press = app-client->_event( 'BUTTON_CANCEL' )
press = client->_event( 'BUTTON_CANCEL' )
)->button(
text = 'Confirm'
press = app-client->_event( 'BUTTON_CONFIRM' )
press = client->_event( 'BUTTON_CONFIRM' )
type = 'Emphasized'
)->get_parent( )->get_parent(
)->text( 'make an input here:'

View File

@ -15,9 +15,9 @@ CLASS z2ui5_cl_app_demo_27 DEFINITION PUBLIC.
DATA input52 TYPE string.
PROTECTED SECTION.
data client TYPE REF TO z2ui5_if_client.
DATA:
BEGIN OF app,
client TYPE REF TO z2ui5_if_client,
check_initialized TYPE abap_bool,
view_main TYPE string,
view_popup TYPE string,
@ -39,7 +39,7 @@ CLASS Z2UI5_CL_APP_DEMO_27 IMPLEMENTATION.
METHOD z2ui5_if_app~controller.
app-client = client.
me->client = client.
app-s_get = client->get( ).
app-view_popup = ``.
@ -66,19 +66,19 @@ CLASS Z2UI5_CL_APP_DEMO_27 IMPLEMENTATION.
CASE app-s_get-event.
WHEN 'BUTTON_POST'.
app-client->popup_message_toast( |{ product } { quantity } - send to the server| ).
client->popup_message_toast( |{ product } { quantity } - send to the server| ).
app-view_popup = 'POPUP_CONFIRM'.
WHEN 'BUTTON_CONFIRM'.
app-client->popup_message_toast( |confirm| ).
client->popup_message_toast( |confirm| ).
app-view_popup = ''.
WHEN 'BUTTON_CANCEL'.
app-client->popup_message_toast( |cancel| ).
client->popup_message_toast( |cancel| ).
app-view_popup = ''.
WHEN 'BACK'.
app-client->nav_app_leave( app-client->get_app( app-s_get-id_prev_app_stack ) ).
client->nav_app_leave( client->get_app( app-s_get-id_prev_app_stack ) ).
ENDCASE.
@ -101,12 +101,12 @@ CLASS Z2UI5_CL_APP_DEMO_27 IMPLEMENTATION.
app-s_next-xml_main = z2ui5_cl_xml_view_helper=>factory(
)->page(
title = 'abap2UI5 - Binding Syntax'
navbuttonpress = app-client->_event( 'BACK' )
navbuttonpress = client->_event( 'BACK' )
shownavbutton = abap_true
)->header_content(
)->link(
text = 'Source_Code'
href = app-client->get( )-url_source_code
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent(
)->simple_form( title = 'Binding Syntax' editable = abap_true
)->content( 'form'
@ -117,43 +117,43 @@ CLASS Z2UI5_CL_APP_DEMO_27 IMPLEMENTATION.
text = 'Expression Binding'
href = 'https://sapui5.hana.ondemand.com/sdk/#/topic/daf6852a04b44d118963968a1239d2c0'
)->label( 'input in uppercase'
)->input( app-client->_bind( input2 )
)->input( client->_bind( input2 )
)->input(
value = '{= $' && app-client->_bind( input2 ) && '.toUpperCase() }'
value = '{= $' && client->_bind( input2 ) && '.toUpperCase() }'
enabled = abap_false
)->label( 'max value of the first two inputs'
)->input( '{ type : "sap.ui.model.type.Integer",' &&
' path:"' && app-client->_bind( val = input31 path = abap_true ) && '" }'
' path:"' && client->_bind( val = input31 path = abap_true ) && '" }'
)->input( '{ type : "sap.ui.model.type.Integer",' && |\n| &&
' path:"' && app-client->_bind( val = input32 path = abap_true ) && '" }'
' path:"' && client->_bind( val = input32 path = abap_true ) && '" }'
)->input(
value = '{= Math.max($' && app-client->_bind( input31 ) &&', $' && app-client->_bind( input32 ) && ') }'
value = '{= Math.max($' && client->_bind( input31 ) &&', $' && client->_bind( input32 ) && ') }'
enabled = abap_false
)->label( 'only enabled when the quantity equals 500'
)->input( '{ type : "sap.ui.model.type.Integer",' &&
' path:"' && app-client->_bind( val = quantity path = abap_true ) && `" }`
' path:"' && client->_bind( val = quantity path = abap_true ) && `" }`
)->input(
value = product
enabled = '{= 500===$' && app-client->_bind( quantity ) && ' }'
enabled = '{= 500===$' && client->_bind( quantity ) && ' }'
)->label( 'RegExp Set to enabled if the input contains VIP, ignoring the case.'
)->input( app-client->_bind( val = input41 )
)->input( client->_bind( val = input41 )
)->button(
text = 'VIP'
enabled = '{= RegExp(''vip'', ''i'').test($' && app-client->_bind( input41 ) && ') }'
enabled = '{= RegExp(''vip'', ''i'').test($' && client->_bind( input41 ) && ') }'
)->label( 'concatenate both inputs'
)->input( app-client->_bind( val = input51 )
)->input( app-client->_bind( val = input52 )
)->input( client->_bind( val = input51 )
)->input( client->_bind( val = input52 )
)->input(
value = '{ parts: [' && |\n| &&
' "' && app-client->_bind( val = input51 path = abap_true ) && '",' && |\n| &&
' "' && app-client->_bind( val = input52 path = abap_true ) && '"' && |\n| &&
' "' && client->_bind( val = input51 path = abap_true ) && '",' && |\n| &&
' "' && client->_bind( val = input52 path = abap_true ) && '"' && |\n| &&
' ] }'
enabled = abap_false

View File

@ -12,8 +12,8 @@ CLASS z2ui5_cl_xml_view_helper DEFINITION
END OF ty_s_name_value.
TYPES ty_t_name_value TYPE STANDARD TABLE OF ty_s_name_value WITH EMPTY KEY.
DATA m_name TYPE string.
DATA m_ns TYPE string.
DATA m_name TYPE string.
DATA m_ns TYPE string.
DATA mt_prop TYPE ty_t_name_value.
DATA m_root TYPE REF TO z2ui5_cl_xml_view_helper.
@ -27,6 +27,13 @@ CLASS z2ui5_cl_xml_view_helper DEFINITION
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view_helper.
CLASS-METHODS hlp_get_source_code_url
IMPORTING
app TYPE ref to z2ui5_if_app
get TYPE z2ui5_if_client=>ty_s_get
RETURNING
VALUE(result) TYPE string.
METHODS constructor
IMPORTING
ns TYPE string_table OPTIONAL.
@ -2054,10 +2061,12 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION.
METHOD title.
data(lv_name) = COND #( WHEN ns = 'f' THEN 'title' ELSE `Title` ).
result = me.
_generic(
ns = ns
name = COND #( WHEN ns = 'f' THEN 'title' ELSE `Title` )
name = lv_name
t_prop = VALUE #(
( n = `text` v = text )
( n = `wrapping` v = _=>get_json_boolean( wrapping ) )
@ -2283,10 +2292,21 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION.
METHOD shell.
result = _generic(
name = `Shell`
ns = ns
).
result = _generic(
name = `Shell`
ns = ns
).
ENDMETHOD.
METHOD hlp_get_source_code_url.
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.

View File

@ -14,6 +14,12 @@ CLASS z2ui5_lcl_utility DEFINITION INHERITING FROM cx_no_check.
RETURNING
VALUE(result) TYPE abap_bool.
CLASS-METHODS get_classname_by_ref
IMPORTING
in TYPE REF TO object
RETURNING
VALUE(result) TYPE string.
PROTECTED SECTION.
PRIVATE SECTION.
@ -21,7 +27,12 @@ ENDCLASS.
CLASS z2ui5_lcl_utility IMPLEMENTATION.
METHOD get_classname_by_ref.
DATA(lv_classname) = cl_abap_classdescr=>get_class_name( in ).
result = substring_after( val = lv_classname sub = `\CLASS=` ).
ENDMETHOD.
METHOD get_json_boolean.

View File

@ -74,9 +74,9 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
( name = to_upper( row-name ) value = to_upper( row-value ) ) ).
DATA(lv_url) = client-t_header[ name = '~path' ]-value.
TRY.
DATA(lv_app) = client-t_param[ name = 'APP' ]-value.
lv_url = lv_url && `?app=` && lv_app.
CATCH cx_root.
ENDTRY.
@ -105,13 +105,11 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
r_result = r_result && `<script>` && |\n| &&
r_result = r_result && `<script id="z2ui5">` && |\n| &&
` sap.ui.getCore().attachInit(function () {` && |\n| &&
` "use strict";` && |\n| &&
|\n| &&
` sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/model/json/JSONModel", "sap/m/MessageBox", "sap/ui/core/Fragment"], function (Controller, JSONModel, MessageBox, Fragment) {` && |\n| &&
` "use strict";` && |\n| &&
` return Controller.extend("z2ui5_controller", {` && |\n| &&
` sap.ui.controller("z2ui5_controller", {` && |\n| &&
|\n| &&
` onAfterRendering: function () {` && |\n| &&
` var oView = this.getView();` && |\n| &&
@ -140,11 +138,13 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
` }));` && |\n| &&
` }` && |\n| &&
` if (sap.z2ui5.oResponse.vViewPopup) {` && |\n| &&
` new sap.ui.core.Fragment.load({` && |\n| &&
` ` && |\n| &&
` jQuery.sap.require("sap.ui.core.Fragment");` && |\n| &&
` sap.ui.core.Fragment.load({` && |\n| &&
` definition: sap.z2ui5.oResponse.vViewPopup,` && |\n| &&
` controller: this,` && |\n| &&
` }).then(function (oFragment) {` && |\n| &&
` oFragment.setModel(new JSONModel(sap.z2ui5.oResponse.oViewModel))` && |\n| &&
` oFragment.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.oViewModel))` && |\n| &&
` this.getView().addDependent(oFragment);` && |\n| &&
` if (!sap.z2ui5.oResponse.OPENBY) { oFragment.open(); } else {` && |\n| &&
` oFragment.openBy(this.getView().byId(sap.z2ui5.oResponse.OPENBY))` && |\n| &&
@ -206,8 +206,13 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
|\n| &&
` Roundtrip: function () {` && |\n| &&
|\n| &&
` if (sap.z2ui5.oView){ sap.z2ui5.oView.destroy( ); }` && |\n| &&
` var xhr = new XMLHttpRequest();` && |\n| &&
` var url = '` && lv_url && `';` && |\n| &&
` if ( sap.startApp ) { var app = sap.startApp; }else` && |\n| &&
` { ` && |\n| &&
` app = ' ` && lv_app && `'; ` && |\n| &&
` }` && |\n| &&
` var url = '` && lv_url && `?app=' + app;` && |\n| &&
` xhr.open("POST", url, true);` && |\n| &&
` xhr.onload = function (that) {` && |\n| &&
|\n| &&
@ -235,17 +240,18 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
` }` && |\n| &&
|\n| &&
` if (sap.z2ui5.oResponse.vView) {` && |\n| &&
` var oModel = new JSONModel(sap.z2ui5.oResponse.oViewModel);` && |\n| &&
` var oModel = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.oViewModel);` && |\n| &&
` var oView = new sap.ui.core.mvc.XMLView.create({` && |\n| &&
` definition: sap.z2ui5.oResponse.vView,` && |\n| &&
` }).then(oView => {` && |\n| &&
` oView.setModel(oModel);` && |\n| &&
` debugger;` && |\n| &&
` oView.placeAt("content");` && |\n| &&
` this.oView = oView;` && |\n| &&
` sap.z2ui5.oView = oView;` && |\n| &&
` });` && |\n| &&
` } else if (sap.z2ui5.oResponse.SET_PREV_VIEW == true) {` && |\n| &&
` var oModel = new JSONModel(sap.z2ui5.oResponseOld.oViewModel);` && |\n| &&
` var oModel = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponseOld.oViewModel);` && |\n| &&
` var oView = new sap.ui.core.mvc.XMLView.create({` && |\n| &&
` definition: sap.z2ui5.oResponseOld.vView` && |\n| &&
` }).then(oView => {` && |\n| &&
@ -259,20 +265,17 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
` xhr.send(JSON.stringify(this.oBody));` && |\n| &&
` },` && |\n| &&
` });` && |\n| &&
` });` && |\n| &&
|\n| &&
` sap.z2ui5 = {};` && |\n| &&
` var oView = new sap.ui.core.mvc.View.create({` && |\n| &&
` type: 'XML',` && |\n| &&
` definition: "<mvc:View controllerName='z2ui5_controller' xmlns:mvc='sap.ui.core.mvc' />",` && |\n| &&
` }).then(oView => {` && |\n| &&
` oView.getController().Roundtrip();` && |\n| &&
` });` && |\n| &&
` if (!sap.z2ui5) {sap.z2ui5 = {}; };` && |\n| &&
` var xml = '<mvc:View controllerName="z2ui5_controller" xmlns:mvc="sap.ui.core.mvc" />';` && |\n| &&
` if (xml == '') { xml = '&lt;mvc:View controllerName="z2ui5_controller" xmlns:mvc="sap.ui.core.mvc" />' };` && |\n| &&
|\n| &&
` debugger;` && |\n| &&
` var oView = sap.ui.xmlview({viewContent:xml});` && |\n| &&
` oView.getController().Roundtrip();` && |\n| &&
|\n| &&
` });` && |\n| &&
|\n| &&
`</script>` && |\n| &&
|\n| &&
`</html>`.
ENDMETHOD.

View File

@ -43,12 +43,6 @@ CLASS z2ui5_lcl_utility DEFINITION INHERITING FROM cx_no_check.
RETURNING
VALUE(result) TYPE string.
CLASS-METHODS get_classname_by_ref
IMPORTING
in TYPE REF TO object
RETURNING
VALUE(result) TYPE string.
CLASS-METHODS get_uuid
RETURNING
VALUE(result) TYPE string.
@ -231,14 +225,6 @@ CLASS z2ui5_lcl_utility IMPLEMENTATION.
ENDMETHOD.
METHOD get_classname_by_ref.
DATA(lv_classname) = cl_abap_classdescr=>get_class_name( in ).
result = substring_after( val = lv_classname sub = `\CLASS=` ).
ENDMETHOD.
METHOD get_replace.
result = iv_val.
@ -913,7 +899,6 @@ CLASS z2ui5_lcl_system_runtime DEFINITION.
BEGIN OF ty_s_next,
check_app_leave TYPE abap_bool,
o_call_app TYPE REF TO z2ui5_if_app,
" s_nav_app_call_new TYPE ty_s_db,
t_after TYPE _=>ty_tt_string,
s_set TYPE z2ui5_if_client=>ty_S_next,
END OF ty_s_next.
@ -1491,7 +1476,7 @@ CLASS z2ui5_lcl_system_runtime IMPLEMENTATION.
TRY.
DATA(lv_classname) = to_upper( z2ui5_cl_http_handler=>client-t_param[ name = `app` ]-value ).
_=>raise( when = xsdbool( lv_classname = `` ) ).
CATCH cx_root.
result = result->set_app_system( ).
RETURN.
@ -1739,15 +1724,12 @@ CLASS z2ui5_lcl_if_client IMPLEMENTATION.
METHOD z2ui5_if_client~get.
result = mo_runtime->ms_actual.
DATA(lv_url) = z2ui5_cl_http_handler=>client-t_header[ name = `referer` ]-value.
SPLIT lv_url AT '?' INTO lv_url DATA(lv_dummy).
result-id = mo_runtime->ms_db-id.
result-id_prev_app = mo_runtime->ms_db-id_prev_app.
result-id_prev_app_stack = mo_runtime->ms_db-id_prev_app_stack.
result-url_app = lv_url && `?sap-client=` && sy-mandt && `&app=` && _=>get_classname_by_ref( mo_runtime->ms_db-o_app ).
result-url_source_code = z2ui5_cl_http_handler=>client-t_header[ name = `origin` ]-value && `/sap/bc/adt/oo/classes/` && _=>get_classname_by_ref( mo_runtime->ms_db-o_app ) && `/source/main`.
result = VALUE #( BASE CORRESPONDING #( mo_runtime->ms_db )
event = mo_runtime->ms_actual-event
event_data = mo_runtime->ms_actual-event_data
t_req_header = z2ui5_cl_http_handler=>client-t_header
t_req_param = z2ui5_cl_http_handler=>client-t_param
).
ENDMETHOD.

View File

@ -16,8 +16,8 @@ INTERFACE z2ui5_if_client
id_prev TYPE string,
id_prev_app TYPE string,
id_prev_app_stack TYPE string,
url_app TYPE string,
url_source_code TYPE string,
t_req_param type ty_t_name_value,
t_req_header type ty_t_name_value,
END OF ty_s_get.
TYPES: