Skip to content

Commit 8b0d7c5

Browse files
authored
Split custom controls (#323)
* split custom controls * refactoring * update
1 parent d147524 commit 8b0d7c5

32 files changed

+172
-2844
lines changed

src/z2ui5_cl_demo_app_000.clas.abap

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,57 +1549,57 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
15491549
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
15501550
).
15511551

1552-
panel->generic_tile(
1553-
header = 'Spreadsheet Control'
1554-
subheader = 'Export Table as XLSX'
1555-
press = client->_event( 'Z2UI5_CL_DEMO_APP_077' )
1556-
mode = 'LineMode'
1557-
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1558-
).
1559-
1560-
panel->generic_tile(
1561-
header = 'Font Awesome Icons'
1562-
press = client->_event( 'z2ui5_cl_demo_app_118' )
1563-
mode = 'LineMode'
1564-
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1565-
).
1566-
1567-
panel->generic_tile(
1568-
header = 'Generate Barcodes'
1569-
subheader = 'bwip-js'
1570-
press = client->_event( 'z2ui5_cl_demo_app_102' )
1571-
mode = 'LineMode'
1572-
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1573-
).
1574-
1575-
panel->generic_tile(
1576-
header = 'Tours & Contextual Help'
1577-
subheader = 'driver.js'
1578-
press = client->_event( 'z2ui5_cl_demo_app_119' )
1579-
mode = 'LineMode'
1580-
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1581-
).
1582-
1583-
panel->generic_tile(
1584-
header = 'Image Mapster'
1585-
press = client->_event( 'Z2UI5_CL_DEMO_APP_142' )
1586-
mode = 'LineMode'
1587-
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1588-
).
1589-
1590-
panel->generic_tile(
1591-
header = 'Animate CSS'
1592-
press = client->_event( 'Z2UI5_CL_DEMO_APP_146' )
1593-
mode = 'LineMode'
1594-
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1595-
).
1596-
1597-
panel->generic_tile(
1598-
header = 'Chart.JS'
1599-
press = client->_event( 'Z2UI5_CL_DEMO_APP_148' )
1600-
mode = 'LineMode'
1601-
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1602-
).
1552+
* panel->generic_tile(
1553+
* header = 'Spreadsheet Control'
1554+
* subheader = 'Export Table as XLSX'
1555+
* press = client->_event( 'Z2UI5_CL_DEMO_APP_077' )
1556+
* mode = 'LineMode'
1557+
* class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1558+
* ).
1559+
*
1560+
* panel->generic_tile(
1561+
* header = 'Font Awesome Icons'
1562+
* press = client->_event( 'z2ui5_cl_demo_app_118' )
1563+
* mode = 'LineMode'
1564+
* class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1565+
* ).
1566+
*
1567+
* panel->generic_tile(
1568+
* header = 'Generate Barcodes'
1569+
* subheader = 'bwip-js'
1570+
* press = client->_event( 'z2ui5_cl_demo_app_102' )
1571+
* mode = 'LineMode'
1572+
* class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1573+
* ).
1574+
*
1575+
* panel->generic_tile(
1576+
* header = 'Tours & Contextual Help'
1577+
* subheader = 'driver.js'
1578+
* press = client->_event( 'z2ui5_cl_demo_app_119' )
1579+
* mode = 'LineMode'
1580+
* class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1581+
* ).
1582+
*
1583+
* panel->generic_tile(
1584+
* header = 'Image Mapster'
1585+
* press = client->_event( 'Z2UI5_CL_DEMO_APP_142' )
1586+
* mode = 'LineMode'
1587+
* class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1588+
* ).
1589+
*
1590+
* panel->generic_tile(
1591+
* header = 'Animate CSS'
1592+
* press = client->_event( 'Z2UI5_CL_DEMO_APP_146' )
1593+
* mode = 'LineMode'
1594+
* class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1595+
* ).
1596+
*
1597+
* panel->generic_tile(
1598+
* header = 'Chart.JS'
1599+
* press = client->_event( 'Z2UI5_CL_DEMO_APP_148' )
1600+
* mode = 'LineMode'
1601+
* class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1602+
* ).
16031603

16041604
panel = page->panel(
16051605
expandable = abap_false

src/z2ui5_cl_demo_app_066.clas.abap

Lines changed: 120 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ CLASS z2ui5_cl_demo_app_066 DEFINITION
4646

4747
DATA mv_ui5_version TYPE string.
4848

49-
DATA mt_messaging TYPE z2ui5_cl_cc_messaging=>ty_t_items.
50-
DATA mt_message_manager TYPE z2ui5_cl_cc_message_m=>ty_t_items.
49+
* DATA mt_messaging TYPE z2ui5_cl_cc_messaging=>ty_t_items.
50+
* DATA mt_message_manager TYPE z2ui5_cl_cc_message_m=>ty_t_items.
5151

5252
PROTECTED SECTION.
5353

@@ -67,137 +67,137 @@ CLASS Z2UI5_CL_DEMO_APP_066 IMPLEMENTATION.
6767

6868
METHOD view_display_detail.
6969

70-
DATA(lo_view_nested) = z2ui5_cl_xml_view=>factory( ).
71-
72-
DATA(page) = lo_view_nested->page( title = `Nested View` ).
73-
74-
page->button( text = 'event' press = client->_event( 'UPDATE_DETAIL' )
75-
)->input( id = `inputNest`
76-
value = `{path:'` && client->_bind_edit( val = mv_input_detail view = client->cs_view-nested path = abap_true ) && `',type:'sap.ui.model.type.String', constraints: { maxLength: 3 } }` ).
77-
78-
page->button(
79-
text = 'button 01'
80-
* type = 'Transparent'
81-
press = client->_event( `NEST_TEST` )
82-
enabled = client->_bind( mv_check_enabled_01 ) ).
83-
84-
page->button(
85-
text = 'button 02'
86-
* type = 'Transparent'
87-
press = client->_event( `NEST_TEST` )
88-
enabled = client->_bind( mv_check_enabled_02 )
89-
).
90-
91-
client->nest_view_display(
92-
val = lo_view_nested->stringify( )
93-
id = `test`
94-
method_insert = 'addMidColumnPage'
95-
method_destroy = 'removeAllMidColumnPages'
96-
).
70+
* DATA(lo_view_nested) = z2ui5_cl_xml_view=>factory( ).
71+
*
72+
* DATA(page) = lo_view_nested->page( title = `Nested View` ).
73+
*
74+
* page->button( text = 'event' press = client->_event( 'UPDATE_DETAIL' )
75+
* )->input( id = `inputNest`
76+
* value = `{path:'` && client->_bind_edit( val = mv_input_detail view = client->cs_view-nested path = abap_true ) && `',type:'sap.ui.model.type.String', constraints: { maxLength: 3 } }` ).
77+
*
78+
* page->button(
79+
* text = 'button 01'
80+
** type = 'Transparent'
81+
* press = client->_event( `NEST_TEST` )
82+
* enabled = client->_bind( mv_check_enabled_01 ) ).
83+
*
84+
* page->button(
85+
* text = 'button 02'
86+
** type = 'Transparent'
87+
* press = client->_event( `NEST_TEST` )
88+
* enabled = client->_bind( mv_check_enabled_02 )
89+
* ).
90+
*
91+
* client->nest_view_display(
92+
* val = lo_view_nested->stringify( )
93+
* id = `test`
94+
* method_insert = 'addMidColumnPage'
95+
* method_destroy = 'removeAllMidColumnPages'
96+
* ).
9797

9898
ENDMETHOD.
9999

100100

101101
METHOD view_display_master.
102102

103-
DATA(view) = z2ui5_cl_xml_view=>factory( ).
104-
105-
IF mv_ui5_version > `1.118`.
106-
view->_z2ui5( )->messaging( client->_bind_edit( mt_messaging ) ).
107-
ELSE.
108-
view->_z2ui5( )->message_manager( client->_bind_edit( mt_message_manager ) ).
109-
ENDIF.
110-
111-
DATA(page) = view->shell(
112-
)->page(
113-
title = 'abap2UI5 - Master Detail Page with Nested View'
114-
navbuttonpress = client->_event( 'BACK' )
115-
shownavbutton = abap_true ).
116-
117-
page->header_content(
118-
)->link( text = 'Demo' target = '_blank' href = `https://twitter.com/abap2UI5/status/1628701535222865922`
119-
)->link(
120-
)->get_parent( ).
121-
122-
DATA(col_layout) = page->flexible_column_layout( layout = 'TwoColumnsBeginExpanded' id ='test' ).
123-
124-
DATA(lr_master) = col_layout->begin_column_pages( ).
125-
126-
client->_bind( mt_tree ).
127-
DATA(tab) = lr_master->vbox( )->tree_table(
128-
rows = `{path:'/MT_TREE', parameters: {arrayNames:['CATEGORIES']}}` ).
129-
tab->tree_columns(
130-
)->tree_column( label = 'Object'
131-
)->tree_template(
132-
)->text( text = '{OBJECT}')->get_parent( )->get_parent(
133-
)->tree_column( label = 'Column2'
134-
)->tree_template(
135-
)->text( text = '{COL2}')->get_parent( )->get_parent(
136-
)->tree_column( label = 'Column3'
137-
)->tree_template(
138-
)->text( text = '{COL3}')->get_parent( )->get_parent(
139-
)->tree_column( label = 'Column4'
140-
)->tree_template(
141-
)->text( text = '{COL4}').
142-
143-
tab->get_parent( )->label( text = `input master` )->input( id = `inputMain`
144-
value = `{path:'` && client->_bind_edit( val = mv_input_master view = client->cs_view-main path = abap_true ) && `',type:'sap.ui.model.type.String', constraints: { maxLength: 3 } }`
145-
)->button( press = client->_event( `TEST` ) text = `button` ).
146-
147-
148-
client->view_display( page->stringify( ) ).
149-
103+
* DATA(view) = z2ui5_cl_xml_view=>factory( ).
104+
*
105+
* IF mv_ui5_version > `1.118`.
106+
* view->_z2ui5( )->messaging( client->_bind_edit( mt_messaging ) ).
107+
* ELSE.
108+
* view->_z2ui5( )->message_manager( client->_bind_edit( mt_message_manager ) ).
109+
* ENDIF.
110+
*
111+
* DATA(page) = view->shell(
112+
* )->page(
113+
* title = 'abap2UI5 - Master Detail Page with Nested View'
114+
* navbuttonpress = client->_event( 'BACK' )
115+
* shownavbutton = abap_true ).
116+
*
117+
* page->header_content(
118+
* )->link( text = 'Demo' target = '_blank' href = `https://twitter.com/abap2UI5/status/1628701535222865922`
119+
* )->link(
120+
* )->get_parent( ).
121+
*
122+
* DATA(col_layout) = page->flexible_column_layout( layout = 'TwoColumnsBeginExpanded' id ='test' ).
123+
*
124+
* DATA(lr_master) = col_layout->begin_column_pages( ).
125+
*
126+
* client->_bind( mt_tree ).
127+
* DATA(tab) = lr_master->vbox( )->tree_table(
128+
* rows = `{path:'/MT_TREE', parameters: {arrayNames:['CATEGORIES']}}` ).
129+
* tab->tree_columns(
130+
* )->tree_column( label = 'Object'
131+
* )->tree_template(
132+
* )->text( text = '{OBJECT}')->get_parent( )->get_parent(
133+
* )->tree_column( label = 'Column2'
134+
* )->tree_template(
135+
* )->text( text = '{COL2}')->get_parent( )->get_parent(
136+
* )->tree_column( label = 'Column3'
137+
* )->tree_template(
138+
* )->text( text = '{COL3}')->get_parent( )->get_parent(
139+
* )->tree_column( label = 'Column4'
140+
* )->tree_template(
141+
* )->text( text = '{COL4}').
142+
*
143+
* tab->get_parent( )->label( text = `input master` )->input( id = `inputMain`
144+
* value = `{path:'` && client->_bind_edit( val = mv_input_master view = client->cs_view-main path = abap_true ) && `',type:'sap.ui.model.type.String', constraints: { maxLength: 3 } }`
145+
* )->button( press = client->_event( `TEST` ) text = `button` ).
146+
*
147+
*
148+
* client->view_display( page->stringify( ) ).
149+
*
150150

151151

152152
ENDMETHOD.
153153

154154

155155
METHOD z2ui5_if_app~main.
156156

157-
me->client = client.
158-
159-
IF check_initialized = abap_false.
160-
check_initialized = abap_true.
161-
162-
mt_tree = VALUE #( ( object = '1' categories = VALUE #( ( object = '1.1' categories = VALUE #( ( object = '1.1.1')
163-
( object = '1.1.2') ) )
164-
( object = '1.2' ) ) )
165-
( object = '2' categories = VALUE #( ( object = '2.1' )
166-
( object = '2.2' ) ) )
167-
( object = '3' categories = VALUE #( ( object = '3.1' )
168-
( object = '3.2' ) ) ) ).
169-
170-
* load two types of message handling
171-
DATA(view) = z2ui5_cl_xml_view=>factory( ).
172-
client->view_display(
173-
view->_z2ui5( )->info_frontend( ui5_version = client->_bind_edit( mv_ui5_version ) )->get_parent(
174-
)->_generic( ns = `html` name = `script` )->_cc_plain_xml( z2ui5_cl_cc_messaging=>get_js( ) )->get_parent(
175-
)->_generic( ns = `html` name = `script` )->_cc_plain_xml( z2ui5_cl_cc_message_m=>get_js( ) )->get_parent(
176-
)->_z2ui5( )->timer( client->_event( `START` )
177-
)->stringify( ) ).
178-
179-
ENDIF.
180-
181-
CASE client->get( )-event.
182-
WHEN 'START'.
183-
view_display_master( ).
184-
view_display_detail( ).
185-
186-
WHEN `UPDATE_DETAIL`.
187-
view_display_detail( ).
188-
189-
WHEN 'TEST'.
190-
client->message_toast_display( `output: ` && mv_input_master ).
191-
192-
WHEN `NEST_TEST`.
193-
194-
mv_check_enabled_01 = xsdbool( mv_check_enabled_01 = abap_false ).
195-
mv_check_enabled_02 = xsdbool( mv_check_enabled_01 = abap_false ).
196-
client->message_toast_display( mv_input_detail ).
197-
198-
WHEN 'BACK'.
199-
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).
200-
ENDCASE.
157+
* me->client = client.
158+
*
159+
* IF check_initialized = abap_false.
160+
* check_initialized = abap_true.
161+
*
162+
* mt_tree = VALUE #( ( object = '1' categories = VALUE #( ( object = '1.1' categories = VALUE #( ( object = '1.1.1')
163+
* ( object = '1.1.2') ) )
164+
* ( object = '1.2' ) ) )
165+
* ( object = '2' categories = VALUE #( ( object = '2.1' )
166+
* ( object = '2.2' ) ) )
167+
* ( object = '3' categories = VALUE #( ( object = '3.1' )
168+
* ( object = '3.2' ) ) ) ).
169+
*
170+
** load two types of message handling
171+
* DATA(view) = z2ui5_cl_xml_view=>factory( ).
172+
* client->view_display(
173+
* view->_z2ui5( )->info_frontend( ui5_version = client->_bind_edit( mv_ui5_version ) )->get_parent(
174+
* )->_generic( ns = `html` name = `script` )->_cc_plain_xml( z2ui5_cl_cc_messaging=>get_js( ) )->get_parent(
175+
* )->_generic( ns = `html` name = `script` )->_cc_plain_xml( z2ui5_cl_cc_message_m=>get_js( ) )->get_parent(
176+
* )->_z2ui5( )->timer( client->_event( `START` )
177+
* )->stringify( ) ).
178+
*
179+
* ENDIF.
180+
*
181+
* CASE client->get( )-event.
182+
* WHEN 'START'.
183+
* view_display_master( ).
184+
* view_display_detail( ).
185+
*
186+
* WHEN `UPDATE_DETAIL`.
187+
* view_display_detail( ).
188+
*
189+
* WHEN 'TEST'.
190+
* client->message_toast_display( `output: ` && mv_input_master ).
191+
*
192+
* WHEN `NEST_TEST`.
193+
*
194+
* mv_check_enabled_01 = xsdbool( mv_check_enabled_01 = abap_false ).
195+
* mv_check_enabled_02 = xsdbool( mv_check_enabled_01 = abap_false ).
196+
* client->message_toast_display( mv_input_detail ).
197+
*
198+
* WHEN 'BACK'.
199+
* client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).
200+
* ENDCASE.
201201

202202
ENDMETHOD.
203203
ENDCLASS.

0 commit comments

Comments
 (0)