diff --git a/src/z2ui5_cl_demo_app_266.clas.abap b/src/z2ui5_cl_demo_app_266.clas.abap index 20e9ac07..988b7df8 100644 --- a/src/z2ui5_cl_demo_app_266.clas.abap +++ b/src/z2ui5_cl_demo_app_266.clas.abap @@ -2,11 +2,12 @@ CLASS z2ui5_cl_demo_app_266 DEFINITION PUBLIC CREATE PUBLIC. -PUBLIC SECTION. + PUBLIC SECTION. - INTERFACES z2ui5_if_app. + INTERFACES z2ui5_if_app. + + DATA check_initialized TYPE abap_bool. - DATA check_initialized TYPE abap_bool. PROTECTED SECTION. DATA client TYPE REF TO z2ui5_if_client. @@ -49,57 +50,57 @@ CLASS z2ui5_cl_demo_app_266 IMPLEMENTATION. target = '_blank' href = 'https://sapui5.hana.ondemand.com/#/entity/sap.m.ToggleButton/sample/sap.m.sample.ToggleButton' ). - page_01->_generic_property( VALUE #( n = `core:require` v = `{ MessageToast: 'sap/m/MessageToast' }` ) ). - DATA(page_02) = page_01->page( - title = `Page` - class = `sapUiContentPadding` - )->custom_header( - )->bar( - )->content_middle( - )->title( level = `H2` text = `Title` )->get_parent( - )->content_right( - )->toggle_button( icon = `sap-icon://edit` - press = `MessageToast.show(${$source>/pressed} ? ${$source>/id} + ' Pressed' : ${$source>/id} + ' Unpressed')` - )->get_parent( )->get_parent( )->get_parent( - - - )->sub_header( - )->bar( - )->content_left( - )->toggle_button( text = `Pressed` enabled = abap_true pressed = abap_true - press = `MessageToast.show(${$source>/pressed} ? ${$source>/id} + ' Pressed' : ${$source>/id} + ' Unpressed')` - )->toggle_button( text = `Pressed & Disabled` enabled = abap_false pressed = abap_true - press = `MessageToast.show(${$source>/pressed} ? ${$source>/id} + ' Pressed' : ${$source>/id} + ' Unpressed')` - )->get_parent( - )->content_right( - )->toggle_button( icon = `sap-icon://action` - press = `MessageToast.show(${$source>/pressed} ? ${$source>/id} + ' Pressed' : ${$source>/id} + ' Unpressed')` - )->toggle_button( icon = `sap-icon://home` enabled = abap_false - press = `MessageToast.show(${$source>/pressed} ? ${$source>/id} + ' Pressed' : ${$source>/id} + ' Unpressed')` - )->get_parent( )->get_parent( )->get_parent( - )->hbox( - )->toggle_button( text = `Disabled` enabled = `false` - press = `MessageToast.show(${$source>/pressed} ? ${$source>/id} + ' Pressed' : ${$source>/id} + ' Unpressed')` )->get( - )->layout_data( - )->flex_item_data( growfactor = `1` )->get_parent( )->get_parent( - )->toggle_button( text = `Pressed` enabled = abap_true pressed = abap_true - press = `MessageToast.show(${$source>/pressed} ? ${$source>/id} + ' Pressed' : ${$source>/id} + ' Unpressed')` )->get( - )->layout_data( - )->flex_item_data( growfactor = `1` )->get_parent( )->get_parent( - )->toggle_button( icon = `sap-icon://action` enabled = abap_true pressed = abap_true - press = `MessageToast.show(${$source>/pressed} ? ${$source>/id} + ' Pressed' : ${$source>/id} + ' Unpressed')` )->get( - )->layout_data( - )->flex_item_data( growfactor = `1` )->get_parent( )->get_parent( )->get_parent( - )->footer( + title = `Page` + class = `sapUiContentPadding` + )->custom_header( )->bar( + )->content_middle( + )->title( level = `H2` text = `Title` + )->get_parent( )->content_right( - )->toggle_button( text = `Pressed & Disabled` enabled = abap_false pressed = abap_true - press = `MessageToast.show(${$source>/pressed} ? ${$source>/id} + ' Pressed' : ${$source>/id} + ' Unpressed')` - )->toggle_button( icon = `sap-icon://action` - press = `MessageToast.show(${$source>/pressed} ? ${$source>/id} + ' Pressed' : ${$source>/id} + ' Unpressed')` - ). - + )->toggle_button( icon = `sap-icon://edit` press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/pressed}` ) ( `${$source>/id}` ) ) ) + )->get_parent( + )->get_parent( + )->get_parent( + )->sub_header( + )->bar( + )->content_left( + )->toggle_button( text = `Pressed` enabled = abap_true pressed = abap_true press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/pressed}` ) ( `${$source>/id}` ) ) ) + )->toggle_button( text = `Pressed & Disabled` enabled = abap_false pressed = abap_true press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/pressed}` ) ( `${$source>/id}` ) ) ) + )->get_parent( + )->content_right( + )->toggle_button( icon = `sap-icon://action` press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/pressed}` ) ( `${$source>/id}` ) ) ) + )->toggle_button( icon = `sap-icon://home` enabled = abap_false press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/pressed}` ) ( `${$source>/id}` ) ) ) + )->get_parent( + )->get_parent( + )->get_parent( + )->hbox( + )->toggle_button( text = `Disabled` enabled = `false` press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/pressed}` ) ( `${$source>/id}` ) ) ) )->get( + )->layout_data( + )->flex_item_data( growfactor = `1` + )->get_parent( + )->get_parent( + )->toggle_button( text = `Pressed` enabled = abap_true pressed = abap_true press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/pressed}` ) ( `${$source>/id}` ) ) ) )->get( + )->layout_data( + )->flex_item_data( growfactor = `1` + )->get_parent( + )->get_parent( + )->toggle_button( icon = `sap-icon://action` enabled = abap_true pressed = abap_true press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/pressed}` ) ( `${$source>/id}` ) ) ) )->get( + )->layout_data( + )->flex_item_data( growfactor = `1` + )->get_parent( + )->get_parent( + )->get_parent( + )->footer( + )->bar( + )->content_right( + )->toggle_button( text = `Pressed & Disabled` enabled = abap_false pressed = abap_true press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/pressed}` ) ( `${$source>/id}` ) ) ) + )->toggle_button( icon = `sap-icon://action` press = client->_event( val = `onPress` t_arg = VALUE #( ( `${$source>/pressed}` ) ( `${$source>/id}` ) ) ) + )->get_parent( + )->get_parent( + )->get_parent( + ). client->view_display( page_02->stringify( ) ). ENDMETHOD. @@ -112,7 +113,14 @@ CLASS z2ui5_cl_demo_app_266 IMPLEMENTATION. client->nav_app_leave( ). WHEN 'CLICK_HINT_ICON'. z2ui5_display_popover( `button_hint_id` ). - ENDCASE. + WHEN 'onPress'. + IF client->get_event_arg( 1 ) = 'X'. + client->message_toast_display( client->get_event_arg( 2 ) && ` Pressed` ). + ELSE. + client->message_toast_display( client->get_event_arg( 2 ) && ` Unpressed` ). + ENDIF. + ENDCASE. + ENDMETHOD. diff --git a/src/z2ui5_cl_demo_app_283.clas.abap b/src/z2ui5_cl_demo_app_283.clas.abap index 288b27c4..50e0f1de 100644 --- a/src/z2ui5_cl_demo_app_283.clas.abap +++ b/src/z2ui5_cl_demo_app_283.clas.abap @@ -1,4 +1,4 @@ -CLASS z2ui5_cl_demo_app_283 DEFINITION + CLASS z2ui5_cl_demo_app_283 DEFINITION PUBLIC CREATE PUBLIC. @@ -52,45 +52,43 @@ CLASS z2ui5_cl_demo_app_283 IMPLEMENTATION. target = '_blank' href = base_url && 'sdk/#/entity/sap.m.FeedInput/sample/sap.m.sample.FeedInput' ). - page->_generic_property( VALUE #( n = `core:require` v = `{ MessageToast: 'sap/m/MessageToast' }` ) ). - page->label( text = `Without Icon` class = `sapUiSmallMarginTop sapUiTinyMarginBottom` ). page->feed_input( - post = `MessageToast.show( 'Posted new feed entry: ' + ${$source>/value} )` + post = client->_event( val = `onPost` t_arg = VALUE #( ( `${$source>/value}` ) ) ) showicon = abap_false ). page->label( text = `With Icon Placeholder` class = `sapUiSmallMarginTop sapUiTinyMarginBottom` ). page->feed_input( - post = `MessageToast.show( 'Posted new feed entry: ' + ${$source>/value} )` + post = client->_event( val = `onPost` t_arg = VALUE #( ( `${$source>/value}` ) ) ) showicon = abap_true ). page->label( text = `With Icon Placeholder` class = `sapUiSmallMarginTop sapUiTinyMarginBottom` ). page->feed_input( - post = `MessageToast.show( 'Posted new feed entry: ' + ${$source>/value} )` + post = client->_event( val = `onPost` t_arg = VALUE #( ( `${$source>/value}` ) ) ) showicon = abap_true icon = base_url && `test-resources/sap/m/images/george_washington.jpg` ). page->label( text = `Disabled` class = `sapUiSmallMarginTop sapUiTinyMarginBottom` ). page->feed_input( - post = `MessageToast.show( 'Posted new feed entry: ' + ${$source>/value} )` + post = client->_event( val = `onPost` t_arg = VALUE #( ( `${$source>/value}` ) ) ) enabled = abap_false showicon = abap_true icon = base_url && `test-resources/sap/m/images/george_washington.jpg` ). page->label( text = `Rows Set to 5` class = `sapUiSmallMarginTop sapUiTinyMarginBottom` ). page->feed_input( - post = `MessageToast.show( 'Posted new feed entry: ' + ${$source>/value} )` + post = client->_event( val = `onPost` t_arg = VALUE #( ( `${$source>/value}` ) ) ) rows = `5` ). page->label( text = `With Exceeded Text` class = `sapUiSmallMarginTop sapUiTinyMarginBottom` ). page->feed_input( - post = `MessageToast.show( 'Posted new feed entry: ' + ${$source>/value} )` + post = client->_event( val = `onPost` t_arg = VALUE #( ( `${$source>/value}` ) ) ) maxlength = `20` showexceededtext = abap_true ). page->label( text = `With Growing` class = `sapUiSmallMarginTop sapUiTinyMarginBottom` ). page->feed_input( - post = `MessageToast.show( 'Posted new feed entry: ' + ${$source>/value} )` + post = client->_event( val = `onPost` t_arg = VALUE #( ( `${$source>/value}` ) ) ) growing = abap_true ). client->view_display( page->stringify( ) ). @@ -105,6 +103,8 @@ CLASS z2ui5_cl_demo_app_283 IMPLEMENTATION. client->nav_app_leave( ). WHEN 'CLICK_HINT_ICON'. z2ui5_display_popover( `button_hint_id` ). + WHEN 'onPost'. + client->message_toast_display( `Posted new feed entry: ` && client->get_event_arg( 1 ) ). ENDCASE. ENDMETHOD.