Skip to content

Commit

Permalink
reafactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
oblomov-dev committed Feb 22, 2024
1 parent c8fda66 commit 2e8c1c8
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 47 deletions.
19 changes: 13 additions & 6 deletions src/z2ui5_cl_demo_app_000.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.

METHOD z2ui5_if_app~main.

data(ls_get) = client->get( ).
DATA(ls_get) = client->get( ).

IF client->get( )-check_on_navigated = abap_true.
IF mt_scroll IS INITIAL.
Expand Down Expand Up @@ -892,11 +892,11 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
).


panel = page->panel(
expandable = abap_false
expanded = abap_true
headertext = `RTTI - Data Typing with S-RTTI`
).
panel = page->panel(
expandable = abap_false
expanded = abap_true
headertext = `RTTI - Data Typing with S-RTTI`
).


panel->generic_tile(
Expand Down Expand Up @@ -942,6 +942,13 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
).

panel->generic_tile(
header = 'Templating'
press = client->_event( 'Z2UI5_CL_DEMO_APP_173' )
mode = 'LineMode'
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
).

page = page2->panel(
expandable = abap_true
expanded = client->_bind_edit( ms_check_expanded-custom_controls )
Expand Down
63 changes: 23 additions & 40 deletions src/z2ui5_cl_demo_app_173.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,49 @@ CLASS z2ui5_cl_demo_app_173 DEFINITION

PUBLIC SECTION.

INTERFACES if_serializable_object .
INTERFACES z2ui5_if_app .
INTERFACES z2ui5_if_app.

TYPES: BEGIN OF ty_s_data,
name TYPE string,
END OF ty_s_data,
ty_t_data TYPE STANDARD TABLE OF ty_s_data WITH EMPTY KEY.
TYPES:
BEGIN OF ty_s_data,
name TYPE string,
END OF ty_s_data,
ty_t_data TYPE STANDARD TABLE OF ty_s_data WITH EMPTY KEY.

DATA mt_data TYPE ty_t_data.
DATA client TYPE REF TO z2ui5_if_client .

PROTECTED SECTION.
PRIVATE SECTION.
METHODS render_main.
ENDCLASS.



CLASS z2ui5_cl_demo_app_173 IMPLEMENTATION.



METHOD z2ui5_if_app~main.

me->client = client.

IF client->get( )-check_on_navigated = abap_true.

mt_data = VALUE #( ( name = 'Theo')
( name = 'Lore' ) ).

client->_bind( mt_data ).

render_main( ).

ENDIF.

ENDMETHOD.

METHOD render_main.
client->_bind( mt_data ).
mt_data = VALUE #( ( name = 'Theo')
( name = 'Lore' ) ).

DATA(xml) =
'<mvc:View xmlns="sap.m" xmlns:mvc="sap.ui.core.mvc" xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1">' &&
' <App> ' &&
' <Page title="XML Templating"> ' &&
' <OverflowToolbar> ' &&
' <ToolbarSpacer /> ' &&
' <template:repeat list="{meta>/MT_DATA}" var="MT_DATA"> ' &&
' <ToggleButton text="{MT_DATA>NAME}" /> ' &&
' </template:repeat> ' &&
' <ToolbarSpacer /> ' &&
' <OverflowToolbarButton icon="sap-icon://action-settings" /> ' &&
' </OverflowToolbar> ' &&
' </Page> ' &&
' </App> ' &&
'</mvc:View>'.
'<mvc:View xmlns="sap.m" xmlns:mvc="sap.ui.core.mvc" xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1">' &&
' <App> ' &&
' <Page title="XML Templating"> ' &&
' <OverflowToolbar> ' &&
' <ToolbarSpacer /> ' &&
' <template:repeat list="{meta>/MT_DATA}" var="MT_DATA"> ' &&
' <ToggleButton text="{MT_DATA>NAME}" /> ' &&
' </template:repeat> ' &&
' <ToolbarSpacer /> ' &&
' <OverflowToolbarButton icon="sap-icon://action-settings" /> ' &&
' </OverflowToolbar> ' &&
' </Page> ' &&
' </App> ' &&
'</mvc:View>'.

client->view_display( xml ).


ENDMETHOD.

ENDCLASS.
2 changes: 1 addition & 1 deletion src/z2ui5_cl_demo_app_173.clas.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_DEMO_APP_173</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>basic - templation</DESCRIPT>
<DESCRIPT>basic - templating</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
Expand Down

0 comments on commit 2e8c1c8

Please sign in to comment.