Skip to content

Commit 04aa74c

Browse files
Cleanup and refactoring Demo 282 (#385)
1 parent 8cf116a commit 04aa74c

File tree

1 file changed

+81
-66
lines changed

1 file changed

+81
-66
lines changed

src/z2ui5_cl_demo_app_282.clas.abap

Lines changed: 81 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -50,73 +50,86 @@ CLASS z2ui5_cl_demo_app_282 IMPLEMENTATION.
5050
target = '_blank'
5151
href = 'https://sapui5.hana.ondemand.com/sdk/#/entity/sap.ui.core.InvisibleText/sample/sap.ui.core.sample.InvisibleText' ).
5252

53-
54-
page_01->_generic_property( VALUE #( n = `core:require` v = `{ MessageToast: 'sap/m/MessageToast' }` ) ).
55-
5653
DATA(page_02) = page_01->page(
57-
title = `Page`
58-
class = `sapUiContentPadding`
59-
)->custom_header(
60-
)->toolbar(
61-
)->button( type = `Back` press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
62-
)->toolbar_spacer(
63-
)->title( text = `Title`
64-
)->toolbar_spacer(
65-
)->button( icon = `sap-icon://edit` press = `MessageToast.show( ${$source>/id} + ' Pressed' )` arialabelledby = `editButtonLabel` )->get_parent( )->get_parent(
66-
67-
)->sub_header(
68-
)->toolbar(
69-
)->toolbar_spacer(
70-
)->button( text = `Default` press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
71-
)->button( type = `Reject` text = `Reject` press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
72-
)->button( icon = `sap-icon://action` press = `MessageToast.show( ${$source>/id} + ' Pressed' )` arialabelledby = `actionButtonLabel`
73-
)->toolbar_spacer( )->get_parent( )->get_parent(
74-
75-
)->content(
76-
)->hbox(
77-
)->button( text = `Default`
78-
press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
79-
ariadescribedby = `defaultButtonDescription genericButtonDescription` )->get(
80-
)->layout_data(
81-
)->flex_item_data( growfactor = `1` )->get_parent( )->get_parent(
82-
)->button( type = `Accept`
83-
text = `Accept`
84-
press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
85-
ariadescribedby = `acceptButtonDescription genericButtonDescription` )->get(
86-
)->layout_data(
87-
)->flex_item_data( growfactor = `1` )->get_parent( )->get_parent(
88-
)->button( type = `Reject`
89-
text = `Reject`
90-
press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
91-
ariadescribedby = `rejectButtonDescription genericButtonDescription` )->get(
92-
)->layout_data(
93-
)->flex_item_data( growfactor = `1` )->get_parent( )->get_parent(
94-
)->button( text = `Coming Soon`
95-
press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
96-
ariadescribedby = `comingSoonButtonDescription genericButtonDescription`
97-
enabled = abap_false )->get(
98-
)->layout_data(
99-
)->flex_item_data( growfactor = `1` )->get_parent( )->get_parent( )->get_parent(
100-
101-
" Collection of labels (some of which are invisible) used to provide ARIA descriptions for the buttons
102-
)->label( id = `genericButtonDescription` text = `Note: The buttons in this sample display MessageToast when pressed.`
103-
104-
)->invisible_text( ns = `core` id = `defaultButtonDescription` text = `Description of default button goes here.` )->get_parent(
105-
)->invisible_text( ns = `core` id = `acceptButtonDescription` text = `Description of accept button goes here.` )->get_parent(
106-
)->invisible_text( ns = `core` id = `rejectButtonDescription` text = `Description of reject button goes here.` )->get_parent(
107-
)->invisible_text( ns = `core` id = `comingSoonButtonDescription` text = `This feature is not active just now.` )->get_parent(
108-
109-
" These labels exist only to provide targets for the ARIA label on the Edit and Action buttons
110-
)->invisible_text( ns = `core` id = `editButtonLabel` text = `Edit Button Label` )->get_parent(
111-
)->invisible_text( ns = `core` id = `actionButtonLabel` text = `Action Button Label` )->get_parent( )->get_parent(
112-
113-
)->footer(
114-
)->toolbar(
115-
)->toolbar_spacer(
116-
)->button( type = `Emphasized` text = `Emphasized` press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
117-
)->button( text = `Default` press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
118-
)->button( icon = `sap-icon://action` press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
119-
).
54+
title = `Page`
55+
class = `sapUiContentPadding`
56+
)->custom_header(
57+
)->toolbar(
58+
)->button( type = `Back` press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/id}` ) ) )
59+
)->toolbar_spacer(
60+
)->title( text = `Title`
61+
)->toolbar_spacer(
62+
)->button( icon = `sap-icon://edit` press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/id}` ) ) ) arialabelledby = `editButtonLabel`
63+
)->get_parent(
64+
65+
)->get_parent(
66+
)->sub_header(
67+
)->toolbar(
68+
)->toolbar_spacer(
69+
)->button( text = `Default` press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/id}` ) ) )
70+
)->button( type = `Reject` text = `Reject` press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/id}` ) ) )
71+
)->button( icon = `sap-icon://action` press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/id}` ) ) ) arialabelledby = `actionButtonLabel`
72+
)->toolbar_spacer(
73+
)->get_parent(
74+
75+
)->get_parent(
76+
)->content(
77+
)->hbox(
78+
)->button( text = `Default`
79+
press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/id}` ) ) )
80+
ariadescribedby = `defaultButtonDescription genericButtonDescription` )->get(
81+
)->layout_data(
82+
)->flex_item_data( growfactor = `1`
83+
)->get_parent(
84+
)->get_parent(
85+
)->button( type = `Accept`
86+
text = `Accept`
87+
press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/id}` ) ) )
88+
ariadescribedby = `acceptButtonDescription genericButtonDescription` )->get(
89+
)->layout_data(
90+
)->flex_item_data( growfactor = `1`
91+
)->get_parent(
92+
)->get_parent(
93+
)->button( type = `Reject`
94+
text = `Reject`
95+
press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/id}` ) ) )
96+
ariadescribedby = `rejectButtonDescription genericButtonDescription` )->get(
97+
)->layout_data(
98+
)->flex_item_data( growfactor = `1`
99+
)->get_parent(
100+
)->get_parent(
101+
)->button( text = `Coming Soon`
102+
press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/id}` ) ) )
103+
ariadescribedby = `comingSoonButtonDescription genericButtonDescription`
104+
enabled = abap_false )->get(
105+
)->layout_data(
106+
)->flex_item_data( growfactor = `1`
107+
)->get_parent(
108+
)->get_parent(
109+
110+
)->get_parent(
111+
112+
" Collection of labels (some of which are invisible) used to provide ARIA descriptions for the buttons
113+
)->label( id = `genericButtonDescription` text = `Note: The buttons in this sample display MessageToast when pressed.`
114+
115+
)->invisible_text( ns = `core` id = `defaultButtonDescription` text = `Description of default button goes here.` )->get_parent(
116+
)->invisible_text( ns = `core` id = `acceptButtonDescription` text = `Description of accept button goes here.` )->get_parent(
117+
)->invisible_text( ns = `core` id = `rejectButtonDescription` text = `Description of reject button goes here.` )->get_parent(
118+
)->invisible_text( ns = `core` id = `comingSoonButtonDescription` text = `This feature is not active just now.` )->get_parent(
119+
120+
" These labels exist only to provide targets for the ARIA label on the Edit and Action buttons
121+
)->invisible_text( ns = `core` id = `editButtonLabel` text = `Edit Button Label` )->get_parent(
122+
)->invisible_text( ns = `core` id = `actionButtonLabel` text = `Action Button Label` )->get_parent(
123+
)->get_parent(
124+
)->footer(
125+
)->toolbar(
126+
)->toolbar_spacer(
127+
)->button( type = `Emphasized` text = `Emphasized` press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/id}` ) ) )
128+
)->button( text = `Default` press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/id}` ) ) )
129+
)->button( icon = `sap-icon://action` press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/id}` ) ) )
130+
)->get_parent(
131+
)->get_parent(
132+
).
120133

121134
client->view_display( page_02->stringify( ) ).
122135

@@ -130,6 +143,8 @@ CLASS z2ui5_cl_demo_app_282 IMPLEMENTATION.
130143
client->nav_app_leave( ).
131144
WHEN 'CLICK_HINT_ICON'.
132145
z2ui5_display_popover( `button_hint_id` ).
146+
WHEN 'onPress'.
147+
client->message_toast_display( client->get_event_arg( 1 ) && ` Pressed` ).
133148
ENDCASE.
134149

135150
ENDMETHOD.

0 commit comments

Comments
 (0)