Launch Tile
Shows Launch Tile samples that can contain header, subheader, image content, unit, and a footer.
Z2UI5_CL_SMPC_APP_517
Controls
sap.m
UI5 1.92
The facts
- Repository
- abap2UI5/samples-controls
- Class
Z2UI5_CL_SMPC_APP_517- Source file
z2ui5_cl_smpc_app_517.clas.abap↗- Library
- sap.m
- UI5 entity
sap.m.GenericTile- Demo kit sample
sap.m.sample.GenericTileAsLaunchTile- SAP's own sample
- running at sdk.openui5.org ↗
- Minimum UI5
- 1.92
- In the playground
- runs in the browser, with no system and nothing installed
Keywords: generictile, generic, tile, sap.m, generictileaslaunchtile, simpleform, label, input, button, html, tilecontent, imagecontent
Controls it builds
- sap.m.Button
- sap.m.GenericTile
- sap.m.ImageContent
- sap.m.Input
- sap.m.Label
- sap.m.TileContent
- sap.ui.core.HTML
- sap.ui.core.mvc.View
- sap.ui.layout.form.SimpleForm
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_517.clas.abap — 282 lines
Click a number to link to a line — shift-click for a range.
Read it on GitHub ↗
" @keywords generictile generic tile sap.m generictileaslaunchtile simpleform label input button html tilecontent imagecontent
" @summary Shows Launch Tile samples that can contain header, subheader, image content, unit, and a footer.
CLASS z2ui5_cl_smpc_app_517 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
DATA loading_seconds TYPE string VALUE `-1`.
DATA tile_state TYPE string VALUE `Loaded`.
PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.
METHODS view_display.
METHODS on_event.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_smpc_app_517 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( ).
view->ele( n = `View` ns = `mvc`
)->a( n = `xmlns` v = `sap.m`
)->a( n = `xmlns:mvc` v = `sap.ui.core.mvc`
)->a( n = `xmlns:form` v = `sap.ui.layout.form`
)->a( n = `xmlns:core` v = `sap.ui.core`
)->ele( n = `SimpleForm` ns = `form`
)->a( n = `editable` v = `true`
)->a( n = `width` v = `40rem`
)->a( n = `layout` v = `ResponsiveGridLayout`
)->tag( `Label`
)->a( n = `text` v = `Loading time`
)->tag( `Input`
)->a( n = `id` v = `loadingMinSeconds`
)->a( n = `width` v = `8rem`
)->a( n = `type` v = `Number`
)->a( n = `description` v = `seconds`
)->a( n = `value` v = client->_bind( loading_seconds )
" onFormSubmit sets every tile to Loading and back to Loaded after the
" entered number of seconds - the state is one bound property and the
" framework's own timer brings it back
)->tag( `Button`
)->a( n = `text` v = `Start loading`
)->a( n = `type` v = `Emphasized`
)->a( n = `press` v = client->_event( `START_LOADING` )
)->end(
)->tag( n = `HTML` ns = `core`
" the sample's own style.css (one rule: .tileLayout floats left) - literal
" braces escaped \{ \} because the XMLView binding parser reads an
" unescaped brace as a binding (the app-028 form)
)->a( n = `content` v = `<style>.tileLayout\{float:left\}</style>`
)->ele( `GenericTile`
)->a( n = `class` v = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout`
)->a( n = `header` v = `Country-Specific Profit Margin`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_global
t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `The GenericTile is pressed.` ) ) )
)->a( n = `frameType` v = `OneByHalf`
)->a( n = `subheader` v = `Subtitle`
)->a( n = `state` v = client->_bind( tile_state )
)->ele( `TileContent`
)->tag( `ImageContent`
)->a( n = `src` v = `https://sdk.openui5.org/test-resources/sap/m/demokit/sample/GenericTileAsLaunchTile/images/SAPLogoLargeTile_28px_height.png`
)->end(
)->end(
)->ele( `GenericTile`
)->a( n = `class` v = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout`
)->a( n = `header` v = `Sales Fulfillment Application Title`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_global
t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `The GenericTile is pressed.` ) ) )
)->a( n = `frameType` v = `TwoByHalf`
)->a( n = `subheader` v = `Subtitle`
)->a( n = `state` v = client->_bind( tile_state )
)->tag( `TileContent`
)->end(
)->ele( `GenericTile`
)->a( n = `class` v = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout`
)->a( n = `header` v = `Manage Activity Master Data Type`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_global
t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `The GenericTile is pressed.` ) ) )
)->a( n = `frameType` v = `TwoByHalf`
)->a( n = `subheader` v = `Subtitle`
)->a( n = `state` v = client->_bind( tile_state )
)->ele( `TileContent`
)->a( n = `unit` v = `EUR`
)->a( n = `footer` v = `Current Quarter`
)->tag( `ImageContent`
)->a( n = `src` v = `sap-icon://home-share`
)->end(
)->end(
)->ele( `GenericTile`
)->a( n = `class` v = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout`
)->a( n = `header` v = `Right click to open in new tab`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_global
t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `The GenericTile is pressed.` ) ) )
)->a( n = `subheader` v = `Link tile`
)->a( n = `url` v = `https://www.sap.com/`
)->a( n = `state` v = client->_bind( tile_state )
)->ele( `TileContent`
)->tag( `ImageContent`
)->a( n = `src` v = `https://sdk.openui5.org/test-resources/sap/m/demokit/sample/GenericTileAsLaunchTile/images/SAPLogoLargeTile_28px_height.png`
)->end(
)->end(
)->ele( `GenericTile`
)->a( n = `class` v = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout`
)->a( n = `header` v = `Sales Fulfillment Application Title`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_global
t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `The GenericTile is pressed.` ) ) )
)->a( n = `subheader` v = `Subtitle`
)->a( n = `state` v = client->_bind( tile_state )
)->ele( `TileContent`
)->a( n = `unit` v = `EUR`
)->a( n = `footer` v = `Current Quarter`
)->tag( `ImageContent`
)->a( n = `src` v = `sap-icon://home-share`
)->end(
)->end(
)->ele( `GenericTile`
)->a( n = `class` v = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout`
)->a( n = `header` v = `Manage Activity Master Data Type`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_global
t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `The GenericTile is pressed.` ) ) )
)->a( n = `subheader` v = `Subtitle`
)->a( n = `state` v = client->_bind( tile_state )
)->ele( `TileContent`
)->tag( `ImageContent`
)->a( n = `src` v = `https://sdk.openui5.org/test-resources/sap/m/demokit/sample/GenericTileAsLaunchTile/images/SAPLogoLargeTile_28px_height.png`
)->end(
)->end(
)->ele( `GenericTile`
)->a( n = `class` v = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout`
)->a( n = `header` v = `Manage Activity Master Data Type With a Long Title Without an Icon`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_global
t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `The GenericTile is pressed.` ) ) )
)->a( n = `subheader` v = `Subtitle Launch Tile`
)->a( n = `mode` v = `HeaderMode`
)->a( n = `state` v = client->_bind( tile_state )
)->ele( `TileContent`
)->a( n = `unit` v = `EUR`
)->a( n = `footer` v = `Current Quarter`
)->end(
)->end(
)->ele( `GenericTile`
)->a( n = `class` v = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout`
)->a( n = `header` v = `Jessica D. Prince Senior Consultant`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_global
t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `The GenericTile is pressed.` ) ) )
)->a( n = `subheader` v = `Department`
)->a( n = `appShortcut` v = `shortcut`
)->a( n = `systemInfo` v = `systeminfo`
)->a( n = `state` v = client->_bind( tile_state )
)->ele( `TileContent`
)->tag( `ImageContent`
)->a( n = `src` v = `https://sdk.openui5.org/test-resources/sap/m/demokit/sample/GenericTileAsLaunchTile/images/ProfileImage_LargeGenTile.png`
)->end(
)->end(
)->ele( `GenericTile`
)->a( n = `class` v = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout`
)->a( n = `header` v = `Sales Fulfillment Application Title`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_global
t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `The GenericTile is pressed.` ) ) )
)->a( n = `frameType` v = `OneByHalf`
)->a( n = `state` v = client->_bind( tile_state )
)->ele( `TileContent`
)->a( n = `unit` v = `EUR`
)->a( n = `footer` v = `Current Quarter`
)->end(
)->end(
)->ele( `GenericTile`
)->a( n = `class` v = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout`
)->a( n = `header` v = `Sales Fulfillment Application Title`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_global
t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `The GenericTile is pressed.` ) ) )
)->a( n = `frameType` v = `TwoByHalf`
)->a( n = `state` v = client->_bind( tile_state )
)->ele( `TileContent`
)->a( n = `unit` v = `EUR`
)->a( n = `footer` v = `Current Quarter`
)->end(
)->end(
)->ele( `GenericTile`
)->a( n = `class` v = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout`
)->a( n = `header` v = `Jessica D. Prince Senior Consultant`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_global
t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `The GenericTile is pressed.` ) ) )
)->a( n = `frameType` v = `TwoByHalf`
)->a( n = `subheader` v = `Department`
)->a( n = `state` v = client->_bind( tile_state )
)->ele( `TileContent`
)->tag( `ImageContent`
)->a( n = `src` v = `https://sdk.openui5.org/test-resources/sap/m/demokit/sample/GenericTileAsLaunchTile/images/ProfileImage_LargeGenTile.png`
)->end( ).
client->view_display( view->stringify( ) ).
ENDMETHOD.
METHOD on_event.
CASE client->get_event( ).
WHEN `START_LOADING`.
tile_state = `Loading`.
" the length term matters as much as the character one: without it
" `99999999999` passes CO and overflows CONV i, and 2147484 already
" overflows the `seconds * 1000` below, which calculates in i
DATA(seconds) = CONV i( COND string( WHEN loading_seconds CO `0123456789` AND loading_seconds IS NOT INITIAL
AND strlen( loading_seconds ) <= 6
THEN loading_seconds
ELSE `0` ) ).
client->follow_up_action( val = client->cs_event-start_timer
t_arg = VALUE #( ( `LOADED` ) ( |{ seconds * 1000 }| ) ) ).
WHEN `LOADED`.
tile_state = `Loaded`.
ENDCASE.
ENDMETHOD.
ENDCLASS.
More in sap.m
- Select - Change Events — Demonstrates the use of 'change' and 'liveChange' events.
- MultiInput - Model update — This sample illustrates how the model bound to the MultiInput can be updated upon token c…
- Object Header Responsive II — This is a responsive Object Header with a Title, 2 Statuses/Attributes rendered below the…
- Flex Box - Size Adjustments — Automatic size adjustments can be achieved for Flex Items with the use of Flex Item Data…
- Input - Assisted — Assisted input is available via suggestions - shown as you type - and a value help dialog.
- Segmented Button in View Settings Dialog — Segmented Button used in View Settings Dialog component
- Object Header – Active Attributes — Active Object Attributes can trigger actions, such as navigating to related content insid…
- MultiComboBox - Suggestions with Value State — MultiComboBox with suggestions and Value State Message containing a link.
- Notification List Group with lazy loading of the notifications — Notification List Group with lazy loading of the notifications.
- Input - Key and Value — This sample illustrates how the Input works with key and value values, when the data is a…
- List - Loading Indication — You can use enableBusyIndicator property to display loading animation while the data is b…
- Table - CellSelector, CopyProvider — This example demonstrates how the Table data can be copied to the clipboard via CopyProvi…
On this page