OverflowToolbar - Alignment
OverflowToolbar and Toolbar are often used for left/right alignment. This is easily achieved with ToolbarSpacer.
Z2UI5_CL_SMPC_APP_396
Controls
sap.m
UI5 1.71
The facts
- Repository
- abap2UI5/samples-controls
- Class
Z2UI5_CL_SMPC_APP_396- Source file
z2ui5_cl_smpc_app_396.clas.abap↗- Library
- sap.m
- UI5 entity
sap.m.OverflowToolbar- Demo kit sample
sap.m.sample.ToolbarAlignment- SAP's own sample
- running at sdk.openui5.org ↗
- Minimum UI5
- 1.71 — the floor abap2UI5 holds its samples to
- In the playground
- runs in the browser, with no system and nothing installed
Keywords: overflowtoolbar, overflow, toolbar, sap.m, toolbaralignment, invisibletext, messagestrip, button, toolbarspacer, checkbox, radiobutton, input
Controls it builds
- sap.m.Button
- sap.m.CheckBox
- sap.m.Input
- sap.m.MessageStrip
- sap.m.OverflowToolbar
- sap.m.Page
- sap.m.RadioButton
- sap.m.ToolbarSpacer
- sap.ui.core.InvisibleText
- 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_396.clas.abap — 171 lines
Click a number to link to a line — shift-click for a range.
Read it on GitHub ↗
" @keywords overflowtoolbar overflow toolbar sap.m toolbaralignment invisibletext messagestrip button toolbarspacer checkbox radiobutton input
" @summary OverflowToolbar and Toolbar are often used for left/right alignment. This is easily achieved with ToolbarSpacer.
CLASS z2ui5_cl_smpc_app_396 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_396 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 = `height` v = `100%`
)->a( n = `xmlns:mvc` v = `sap.ui.core.mvc`
)->a( n = `xmlns:core` v = `sap.ui.core`
)->a( n = `xmlns` v = `sap.m`
)->ele( `Page`
)->tag( n = `InvisibleText` ns = `core`
)->a( n = `id` v = `inputLabel`
)->a( n = `text` v = `Input label`
)->tag( `MessageStrip`
)->a( n = `text` v = `Left and Right aligned content.`
)->a( n = `class` v = `sapUiTinyMargin`
)->ele( `OverflowToolbar`
)->a( n = `class` v = `sapUiMediumMarginTop`
)->tag( `Button`
)->a( n = `text` v = `Reject`
)->a( n = `type` v = `Reject`
)->tag( `ToolbarSpacer`
)->tag( `Button`
)->a( n = `text` v = `Accept`
)->a( n = `type` v = `Accept`
)->end(
)->tag( `MessageStrip`
)->a( n = `text` v = `Centered content.`
)->a( n = `class` v = `sapUiTinyMargin`
)->ele( `OverflowToolbar`
)->a( n = `class` v = `sapUiMediumMarginTop`
)->tag( `ToolbarSpacer`
)->tag( `Button`
)->a( n = `text` v = `Centered content`
)->a( n = `type` v = `Accept`
)->tag( `ToolbarSpacer`
)->end(
)->tag( `MessageStrip`
)->a( n = `text` v = `Right Aligned Content.`
)->a( n = `class` v = `sapUiTinyMargin`
)->ele( `OverflowToolbar`
)->a( n = `class` v = `sapUiMediumMarginTop`
)->tag( `ToolbarSpacer`
)->tag( `Button`
)->a( n = `text` v = `Right aligned content`
)->a( n = `type` v = `Accept`
)->end(
)->tag( `MessageStrip`
)->a( n = `text` v = `You can have as many sections as you want with ToolbarSpacer.`
)->a( n = `class` v = `sapUiTinyMargin`
)->ele( `OverflowToolbar`
)->a( n = `class` v = `sapUiMediumMarginTop`
)->tag( `Button`
)->a( n = `text` v = `Accept`
)->a( n = `type` v = `Accept`
)->tag( `ToolbarSpacer`
)->tag( `CheckBox`
)->a( n = `text` v = `CheckBox`
)->tag( `ToolbarSpacer`
)->tag( `Button`
)->a( n = `tooltip` v = `Dropdown`
)->a( n = `icon` v = `sap-icon://drop-down-list`
)->tag( `ToolbarSpacer`
)->tag( `RadioButton`
)->a( n = `text` v = `RadioButton`
)->tag( `ToolbarSpacer`
)->tag( `Button`
)->a( n = `text` v = `Reject`
)->a( n = `type` v = `Reject`
)->end(
)->tag( `MessageStrip`
)->a( n = `text`
v = `Flexible Toolbar Spacers share the free horizontal space equally, thus content centering is not as precise as in Bar.`
)->a( n = `class` v = `sapUiTinyMargin`
)->ele( `OverflowToolbar`
)->a( n = `class` v = `sapUiMediumMarginTop`
)->tag( `Button`
)->a( n = `text` v = `This is a very long button text. This is a very long button text.`
)->tag( `ToolbarSpacer`
)->tag( `Button`
)->a( n = `text` v = `Centered Button`
)->tag( `ToolbarSpacer`
)->tag( `Button`
)->a( n = `text` v = `Short Button`
)->end(
)->tag( `MessageStrip`
)->a( n = `text` v = `ToolbarSpacer does not have to be flexible, a fixed width can be specified too.`
)->a( n = `class` v = `sapUiTinyMargin`
)->ele( `OverflowToolbar`
)->a( n = `class` v = `sapUiMediumMarginTop`
)->tag( `Input`
)->a( n = `ariaLabelledBy` v = `inputLabel`
)->a( n = `width` v = `100px`
)->a( n = `placeholder` v = `First Name`
)->tag( `Input`
)->a( n = `ariaLabelledBy` v = `inputLabel`
)->a( n = `width` v = `100px`
)->a( n = `placeholder` v = `Last Name`
)->tag( `ToolbarSpacer`
)->a( n = `width` v = `40px`
)->tag( `Input`
)->a( n = `ariaLabelledBy` v = `inputLabel`
)->a( n = `type` v = `Email`
)->a( n = `width` v = `100px`
)->a( n = `placeholder` v = `Email`
)->tag( `Input`
)->a( n = `ariaLabelledBy` v = `inputLabel`
)->a( n = `type` v = `Number`
)->a( n = `width` v = `80px`
)->a( n = `placeholder` v = `Age`
)->tag( `ToolbarSpacer`
)->tag( `Button`
)->a( n = `text` v = `Submit`
)->a( n = `type` v = `Accept` ).
client->view_display( view->stringify( ) ).
ENDMETHOD.
ENDCLASS.
More in sap.m
- Numeric Content Without Margins — This is an example of the NumericContent that contains no margins, so the control is alig…
- Segmented Button in Input List Item — Segmented Button used in Input List Item component
- Flex Box - Basic Alignment — Flex Box items can be placed in different areas using the justifyContent and alignItem pr…
- Flex Box - Direction & Order — You can influence the direction and order of elements in horizontal and vertical Flex Box…
- Flex Box - Opposing Alignment — In this Flex Box the items are aligned at opposing ends of the container with justifyCont…
- Placing a Title in OverflowToolbar/Toolbar — The sap.m.Title control can be used to place a title inside an OverflowToolbar/Toolbar.
- Panel — Panels are helpful to group custom content. They can be decorated with header and info to…
- Carousel — A sample of a Carousel that contains images.
- Image — Images are faster than words and attract people's attention. Images can also have an acti…
- Object Header - with Circle-shaped Image — An Object Header can set shape of the image by using 'imageShape' property. The shapes co…
- Time Picker - Value States — This example shows different TimePicker value states.
- Flexible sizing - Toolbar — This page shows flexible sizing with a Toolbar. The upper part extends with its content…
On this page