Feed Input
This sample shows a standalone feed input with different settings.
Z2UI5_CL_SMPC_APP_236
Controls
sap.m
UI5 1.139
The facts
- Repository
- abap2UI5/samples-controls
- Class
Z2UI5_CL_SMPC_APP_236- Source file
z2ui5_cl_smpc_app_236.clas.abap↗- Library
- sap.m
- UI5 entity
sap.m.FeedInput- Demo kit sample
sap.m.sample.FeedInput- SAP's own sample
- running at sdk.openui5.org ↗
- Minimum UI5
- 1.139
- In the playground
- runs in the browser, with no system and nothing installed
Keywords: feedinput, feed, input, sap.m, label, button, dialog, text
Controls it builds
- sap.m.Button
- sap.m.Dialog
- sap.m.FeedInput
- sap.m.Label
- sap.m.Text
- sap.ui.core.FragmentDefinition
- sap.ui.core.mvc.View
Read out of the builder chain by the abap2UI5 linter, not from the category this sample is filed under — which is what makes “which samples build one of these” a question the catalogue can answer at all.
Libraries
Run it here
The sample running, in this page — the app on its own, with no editor over it.
Switch to Playground with this code
Nothing is installed and nothing is sent anywhere: the ABAP is compiled to JavaScript in this browser and runs against abap2UI5 itself.
The ABAP
z2ui5_cl_smpc_app_236.clas.abap — 194 lines
Click a number to link to a line — shift-click for a range.
Read it on GitHub ↗
" @keywords feedinput feed input sap.m label button dialog text
" @summary This sample shows a standalone feed input with different settings.
CLASS z2ui5_cl_smpc_app_236 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.
" id of the FeedInput whose action button opened the dialog (original:
" oEvent.getSource().getParent()) - transported as a static button t_arg
DATA action_feed_id TYPE string.
METHODS view_display.
METHODS on_event.
METHODS popup_action_display.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_smpc_app_236 IMPLEMENTATION.
METHOD z2ui5_if_app~main.
me->client = client.
IF client->check_on_navigated( ).
view_display( ).
ELSEIF client->check_on_event( ).
on_event( ).
ENDIF.
ENDMETHOD.
METHOD view_display.
DATA(view) = z2ui5_cl_ui5_view_builder=>factory( ).
" the original controller's onPost does MessageToast.show( "Posted new feed entry: " + evt.getParameter( "value" ) );
" reproduced roundtrip-free as a client-composed toast, {0} filled by the post event's value parameter
view->ele( n = `View` ns = `mvc`
)->a( n = `xmlns:mvc` v = `sap.ui.core.mvc`
)->a( n = `xmlns` v = `sap.m`
)->tag( `Label`
)->a( n = `text` v = `Without Icon`
)->a( n = `class` v = `sapUiSmallMarginTop sapUiTinyMarginBottom`
)->tag( `FeedInput`
)->a( n = `post` v = client->follow_up_action( val = client->cs_event-control_global t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `Posted new feed entry: {0}` ) ( `${$parameters>/value}` ) ) )
)->a( n = `showIcon` v = `false`
)->tag( `Label`
)->a( n = `text` v = `With Icon Placeholder`
)->a( n = `class` v = `sapUiSmallMarginTop sapUiTinyMarginBottom`
)->tag( `FeedInput`
)->a( n = `post` v = client->follow_up_action( val = client->cs_event-control_global t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `Posted new feed entry: {0}` ) ( `${$parameters>/value}` ) ) )
)->a( n = `showIcon` v = `true`
)->tag( `Label`
)->a( n = `text` v = `With Icon`
)->a( n = `class` v = `sapUiSmallMarginTop sapUiTinyMarginBottom`
)->tag( `FeedInput`
)->a( n = `post` v = client->follow_up_action( val = client->cs_event-control_global t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `Posted new feed entry: {0}` ) ( `${$parameters>/value}` ) ) )
)->a( n = `showIcon` v = `true`
" test-resources image rehosted to the OpenUI5 host per the asset-URL rule
)->a( n = `icon` v = `https://sdk.openui5.org/test-resources/sap/m/images/george_washington.jpg`
)->tag( `Label`
)->a( n = `text` v = `Disabled`
)->a( n = `class` v = `sapUiSmallMarginTop sapUiTinyMarginBottom`
)->tag( `FeedInput`
)->a( n = `post` v = client->follow_up_action( val = client->cs_event-control_global t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `Posted new feed entry: {0}` ) ( `${$parameters>/value}` ) ) )
)->a( n = `enabled` v = `false`
)->a( n = `showIcon` v = `true`
)->a( n = `icon` v = `https://sdk.openui5.org/test-resources/sap/m/images/george_washington.jpg`
)->tag( `Label`
)->a( n = `text` v = `Rows Set to 5`
)->a( n = `class` v = `sapUiSmallMarginTop sapUiTinyMarginBottom`
)->tag( `FeedInput`
)->a( n = `post` v = client->follow_up_action( val = client->cs_event-control_global t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `Posted new feed entry: {0}` ) ( `${$parameters>/value}` ) ) )
)->a( n = `rows` v = `5`
)->tag( `Label`
)->a( n = `text` v = `With Exceeded Text`
)->a( n = `class` v = `sapUiSmallMarginTop sapUiTinyMarginBottom`
)->tag( `FeedInput`
)->a( n = `post` v = client->follow_up_action( val = client->cs_event-control_global t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `Posted new feed entry: {0}` ) ( `${$parameters>/value}` ) ) )
)->a( n = `maxLength` v = `20`
)->a( n = `showExceededText` v = `true`
)->tag( `Label`
)->a( n = `text` v = `With Growing`
)->a( n = `class` v = `sapUiSmallMarginTop sapUiTinyMarginBottom`
)->tag( `FeedInput`
)->a( n = `post` v = client->follow_up_action( val = client->cs_event-control_global t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `Posted new feed entry: {0}` ) ( `${$parameters>/value}` ) ) )
)->a( n = `growing` v = `true`
)->tag( `Label`
)->a( n = `text` v = `Without Icon and an enabled Action Button`
)->a( n = `class` v = `sapUiSmallMarginTop sapUiTinyMarginBottom`
)->ele( `FeedInput`
)->a( n = `id` v = `feedActionPlain`
)->a( n = `post` v = client->follow_up_action( val = client->cs_event-control_global t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `Posted new feed entry: {0}` ) ( `${$parameters>/value}` ) ) )
)->a( n = `showIcon` v = `false`
)->ele( `actions`
)->tag( `Button`
)->a( n = `icon` v = `sap-icon://action`
)->a( n = `press` v = client->_event( val = `ACTION_PRESS` arg = `feedActionPlain` )
)->end(
)->end(
)->tag( `Label`
)->a( n = `text` v = `With an Icon Placeholder and an enabled Action Button`
)->a( n = `class` v = `sapUiSmallMarginTop sapUiTinyMarginBottom`
)->ele( `FeedInput`
)->a( n = `id` v = `feedActionIcon`
)->a( n = `post` v = client->follow_up_action( val = client->cs_event-control_global t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `Posted new feed entry: {0}` ) ( `${$parameters>/value}` ) ) )
)->a( n = `showIcon` v = `true`
)->ele( `actions`
)->tag( `Button`
)->a( n = `icon` v = `sap-icon://action`
)->a( n = `press` v = client->_event( val = `ACTION_PRESS` arg = `feedActionIcon` ) ).
client->view_display( view->stringify( ) ).
ENDMETHOD.
METHOD on_event.
CASE client->get_event( ).
WHEN `ACTION_PRESS`.
action_feed_id = client->get_event_arg( ).
popup_action_display( ).
WHEN `ENABLE_POST`.
" original: oFeedInput.enablePostButton( true ) - 1:1 via the
" CONTROL_METHODS entry enablePostButton (framework 2026-07-27)
client->follow_up_action( val = client->cs_event-control_by_id
t_arg = VALUE #( ( action_feed_id ) ( `enablePostButton` ) ( `X` ) ) ).
client->popup_destroy( ).
WHEN `DISABLE_POST`.
client->follow_up_action( val = client->cs_event-control_by_id
t_arg = VALUE #( ( action_feed_id ) ( `enablePostButton` ) ( `false` ) ) ).
client->popup_destroy( ).
ENDCASE.
ENDMETHOD.
METHOD popup_action_display.
DATA(popup) = z2ui5_cl_ui5_view_builder=>factory( ).
" the original onActionButtonPress builds this Dialog imperatively (new Dialog({...}).open());
" expressed 1:1 as a core:FragmentDefinition shown via popup_display. The begin/end buttons
" toggle the owning FeedInput's Post button via the whitelisted enablePostButton
" control method (framework 2026-07-27) and close the popup server-side
popup->ele( n = `FragmentDefinition` ns = `core`
)->a( n = `xmlns:core` v = `sap.ui.core`
)->a( n = `xmlns` v = `sap.m`
)->ele( `Dialog`
)->a( n = `title` v = `Action Button Dialog`
)->ele( `content`
)->tag( `Text`
)->a( n = `text` v = `Choose an action.`
)->end(
)->ele( `beginButton`
)->tag( `Button`
)->a( n = `text` v = `Enable Post Button`
)->a( n = `press` v = client->_event( `ENABLE_POST` )
)->end(
)->ele( `endButton`
)->tag( `Button`
)->a( n = `text` v = `Disable Post Button`
)->a( n = `press` v = client->_event( `DISABLE_POST` ) ).
client->popup_display( popup->stringify( ) ).
ENDMETHOD.
ENDCLASS.
More in sap.m
- Standard List Item — This list item offers a standardized user interface for list content with only title.
- List - Selection — 'Single selection' forces the user to choose exactly one out of many items. With the 'mul…
- Table - Strict layout — This example demonstrates the Strict layout and the column resizing of the table.
- Popover — The Popover controls allows to show contextual information without leaving the current pa…
- InitialPage Pattern — The initial page floorplan allows the user to navigate to a single object to view or edit…
- Facet Filter - Simple — With the Facet Filter you can offer multiple filters ('facets') to assist the user in nar…
- Object Marker in a table — The ObjectMarker is a small building block representing an object by an icon or text and…
- Nav Container — The Nav Container stacks multiple pages and offers an API to switch between them with som…
- Responsive Popover — The Responsive Popover is an abstraction of Popover and Dialog. On the phone a Dialog wil…
- Button with Badge — Button with a Badge attached
- Color Palette as popover — The ColorPalette in a popover (by use of thin wrapper control sap.m.ColorPalettePopover).
- Busy Dialog - Light — This is a 'light' version of the standard Busy Dialog; it also blocks the user interface…
On this page