ToolHeader
ToolHeader that mimics the content of the Shell.
Z2UI5_CL_SMPC_APP_134
Controls
sap.tnt
UI5 1.96
The facts
- Repository
- abap2UI5/samples-controls
- Class
Z2UI5_CL_SMPC_APP_134- Source file
z2ui5_cl_smpc_app_134.clas.abap↗- Library
- sap.tnt
- UI5 entity
sap.tnt.ToolHeader- Demo kit sample
sap.tnt.sample.ToolHeader- SAP's own sample
- running at sdk.openui5.org ↗
- Minimum UI5
- 1.96
- In the playground
- runs in the browser, with no system and nothing installed
Keywords: toolheader, tool, header, sap.tnt, app, shell, scrollcontainer, button, overflowtoolbarlayoutdata, image, title, text
Controls it builds
- sap.m.Avatar
- sap.m.Button
- sap.m.Image
- sap.m.OverflowToolbarButton
- sap.m.OverflowToolbarLayoutData
- sap.m.ScrollContainer
- sap.m.SearchField
- sap.m.Text
- sap.m.Title
- sap.m.ToolbarSpacer
- sap.tnt.ToolHeader
- sap.tnt.ToolHeaderUtilitySeparator
- 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_134.clas.abap — 215 lines
Click a number to link to a line — shift-click for a range.
Read it on GitHub ↗
" @keywords toolheader tool header sap.tnt app shell scrollcontainer button overflowtoolbarlayoutdata image title text
" @summary ToolHeader that mimics the content of the Shell.
CLASS z2ui5_cl_smpc_app_134 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.
METHODS view_display.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_smpc_app_134 IMPLEMENTATION.
METHOD z2ui5_if_app~main.
me->client = client.
IF client->check_on_navigated( ).
view_display( ).
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:tnt` v = `sap.tnt`
)->a( n = `height` v = `100%`
)->ele( `ScrollContainer`
)->a( n = `vertical` v = `true`
)->a( n = `height` v = `100%`
)->ele( n = `ToolHeader` ns = `tnt`
)->a( n = `id` v = `shellLikeToolHeader`
)->a( n = `class` v = `sapUiTinyMargin`
)->ele( `Button`
)->a( n = `icon` v = `sap-icon://menu2`
)->a( n = `type` v = `Transparent`
)->a( n = `tooltip` v = `Menu`
)->ele( `layoutData`
)->tag( `OverflowToolbarLayoutData`
)->a( n = `priority` v = `NeverOverflow`
)->end(
)->end(
" image assets rewritten to the OpenUI5 host per the runtime asset-URL rule
)->ele( `Image`
)->a( n = `src` v = `https://sdk.openui5.org/test-resources/sap/tnt/images/SAP_Logo.png`
)->a( n = `decorative` v = `false`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_global t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `Logo pressed!` ) ) )
)->a( n = `tooltip` v = `SAP Logo`
)->a( n = `width` v = `60px`
)->a( n = `height` v = `30px`
)->ele( `layoutData`
)->tag( `OverflowToolbarLayoutData`
)->a( n = `priority` v = `NeverOverflow`
)->end(
)->end(
)->ele( `Title`
)->a( n = `text` v = `Prоduct Name`
)->a( n = `wrapping` v = `false`
)->a( n = `id` v = `productName`
)->ele( `layoutData`
)->tag( `OverflowToolbarLayoutData`
)->a( n = `priority` v = `Disappear`
)->end(
)->end(
)->ele( `Text`
)->a( n = `text` v = `Second title`
)->a( n = `wrapping` v = `false`
)->a( n = `id` v = `secondTitle`
)->ele( `layoutData`
)->tag( `OverflowToolbarLayoutData`
)->a( n = `priority` v = `Disappear`
)->end(
)->end(
)->tag( `ToolbarSpacer`
)->ele( `SearchField`
)->a( n = `width` v = `25rem`
)->a( n = `id` v = `searchField`
)->ele( `layoutData`
)->tag( `OverflowToolbarLayoutData`
)->a( n = `priority` v = `Low`
)->a( n = `group` v = `1`
)->end(
)->end(
)->tag( `Button`
)->a( n = `visible` v = `false`
)->a( n = `icon` v = `sap-icon://search`
)->a( n = `type` v = `Transparent`
)->a( n = `id` v = `searchButton`
)->a( n = `tooltip` v = `Search`
)->ele( `OverflowToolbarButton`
)->a( n = `icon` v = `sap-icon://da`
)->a( n = `type` v = `Transparent`
)->a( n = `tooltip` v = `Joule`
)->a( n = `text` v = `Joule`
)->ele( `layoutData`
)->tag( `OverflowToolbarLayoutData`
)->a( n = `group` v = `2`
)->end(
)->end(
)->ele( `OverflowToolbarButton`
)->a( n = `icon` v = `sap-icon://source-code`
)->a( n = `type` v = `Transparent`
)->a( n = `tooltip` v = `Action 1`
)->a( n = `text` v = `Action 1`
)->ele( `layoutData`
)->tag( `OverflowToolbarLayoutData`
)->a( n = `group` v = `2`
)->end(
)->end(
)->ele( `OverflowToolbarButton`
)->a( n = `icon` v = `sap-icon://card`
)->a( n = `type` v = `Transparent`
)->a( n = `tooltip` v = `Action 2`
)->a( n = `text` v = `Action 2`
)->ele( `layoutData`
)->tag( `OverflowToolbarLayoutData`
)->a( n = `group` v = `2`
)->end(
)->end(
)->tag( `OverflowToolbarButton`
)->a( n = `icon` v = `sap-icon://action-settings`
)->a( n = `type` v = `Transparent`
)->a( n = `text` v = `Settings`
)->ele( `Button`
)->a( n = `icon` v = `sap-icon://bell`
)->a( n = `type` v = `Transparent`
)->a( n = `tooltip` v = `Notification`
)->ele( `layoutData`
)->tag( `OverflowToolbarLayoutData`
)->a( n = `priority` v = `NeverOverflow`
)->end(
)->end(
)->tag( n = `ToolHeaderUtilitySeparator` ns = `tnt`
)->tag( `OverflowToolbarButton`
)->a( n = `icon` v = `sap-icon://grid`
)->a( n = `type` v = `Transparent`
)->a( n = `text` v = `My Products`
)->a( n = `tooltip` v = `My Products`
" Avatar is a control @since 1.73 - kept 1:1 (POST_171)
)->ele( `Avatar`
)->a( n = `src` v = `https://sdk.openui5.org/test-resources/sap/tnt/images/Woman_avatar_01.png`
)->a( n = `displaySize` v = `XS`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_global t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `Avatar pressed!` ) ) )
)->a( n = `tooltip` v = `Profile`
)->ele( `layoutData`
)->tag( `OverflowToolbarLayoutData`
)->a( n = `priority` v = `NeverOverflow`
)->end(
)->end(
)->end(
)->ele( n = `ToolHeader` ns = `tnt`
)->a( n = `id` v = `shellLikeToolHeaderOnlyMandatoryControls`
)->a( n = `class` v = `sapUiTinyMargin sapUiLargeMarginTop`
)->ele( `Image`
)->a( n = `src` v = `https://sdk.openui5.org/test-resources/sap/tnt/images/SAP_Logo.png`
)->a( n = `decorative` v = `false`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_global t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `Logo pressed!` ) ) )
)->a( n = `tooltip` v = `SAP Logo`
)->a( n = `width` v = `60px`
)->a( n = `height` v = `30px`
)->ele( `layoutData`
)->tag( `OverflowToolbarLayoutData`
)->a( n = `priority` v = `NeverOverflow`
)->end(
)->end(
)->ele( `Title`
)->a( n = `text` v = `Prоduct Name`
)->a( n = `wrapping` v = `false`
)->ele( `layoutData`
)->tag( `OverflowToolbarLayoutData`
)->a( n = `priority` v = `Disappear`
)->end(
)->end(
)->tag( `ToolbarSpacer`
)->ele( `Avatar`
)->a( n = `src` v = `https://sdk.openui5.org/test-resources/sap/tnt/images/Woman_avatar_01.png`
)->a( n = `displaySize` v = `XS`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_global t_arg = VALUE #( ( `MESSAGE_TOAST` ) ( `show` ) ( `Avatar pressed!` ) ) )
)->a( n = `tooltip` v = `Profile`
)->ele( `layoutData`
)->tag( `OverflowToolbarLayoutData`
)->a( n = `priority` v = `NeverOverflow` ).
client->view_display( view->stringify( ) ).
ENDMETHOD.
ENDCLASS.
More in sap.tnt
- InfoLabel — InfoLabel with all available color schemes
- Navigation List — Navigation List in a Page
- Side Navigation — SideNavigation in container with fixed width.
- Side Navigation - Tags — SideNavigation with tags for status indicators and metadata.
- InfoLabel in DynamicPage — InfoLabel used as subheader in DynamicPage
- Tool Page with Vertical Navigation — A tool page layout with vertical navigation
- Side Navigation - Unselectable Parent Items — SideNavigation with unselectable parent items.
- InfoLabel in Table — InfoLabel used in content of Table
- ToolHeader with IconTabHeader — ToolHeader can contain IconTabHeader. When both controls are combined, the IconTabHeader…
- Side Navigation - Press Event — SideNavigation with press event parameters and preventDefault.
- Side Navigation - Actions — SideNavigation with a quick create action button.
- Side Navigation - Wrapping of long texts — SideNavigation with long texts that wrap.
On this page