OverflowToolbar - Design and styling
The Design and Style properties can be used to specify the visual design of the OverflowToolbar/Toolbar.
Z2UI5_CL_SMPC_APP_086
Controls
sap.m
UI5 1.71
The facts
- Repository
- abap2UI5/samples-controls
- Class
Z2UI5_CL_SMPC_APP_086- Source file
z2ui5_cl_smpc_app_086.clas.abap↗- Library
- sap.m
- UI5 entity
sap.m.OverflowToolbar- Demo kit sample
sap.m.sample.ToolbarDesign- 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, design, style, selection, simpleform, label, select, item, button
Controls it builds
- sap.m.Button
- sap.m.Label
- sap.m.OverflowToolbar
- sap.m.Page
- sap.m.Select
- sap.ui.core.Item
- 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_086.clas.abap — 119 lines
Click a number to link to a line — shift-click for a range.
Read it on GitHub ↗
" @keywords overflowtoolbar overflow toolbar sap.m design style selection simpleform label select item button
" @summary The Design and Style properties can be used to specify the visual design of the OverflowToolbar/Toolbar.
CLASS z2ui5_cl_smpc_app_086 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
TYPES:
BEGIN OF ty_s_key,
key TYPE string,
END OF ty_s_key.
DATA t_design_types TYPE STANDARD TABLE OF ty_s_key WITH EMPTY KEY.
DATA t_style_types TYPE STANDARD TABLE OF ty_s_key WITH EMPTY KEY.
DATA design TYPE string.
DATA style TYPE string.
PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.
METHODS view_display.
METHODS model_init.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_smpc_app_086 IMPLEMENTATION.
METHOD z2ui5_if_app~main.
me->client = client.
IF client->check_on_init( ).
model_init( ).
view_display( ).
ELSEIF 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:core` v = `sap.ui.core`
)->a( n = `xmlns:mvc` v = `sap.ui.core.mvc`
)->a( n = `xmlns:form` v = `sap.ui.layout.form`
)->a( n = `xmlns` v = `sap.m`
)->ele( `Page`
)->a( n = `showHeader` v = `false`
)->ele( `content`
)->ele( n = `SimpleForm` ns = `form`
)->a( n = `editable` v = `true`
)->a( n = `width` v = `320px`
)->a( n = `layout` v = `ColumnLayout`
)->tag( `Label`
)->a( n = `text` v = `Design`
)->ele( `Select`
)->a( n = `selectedKey` v = client->_bind( design )
)->a( n = `items` v = client->_bind( t_design_types )
)->tag( n = `Item` ns = `core`
)->a( n = `key` v = `{KEY}`
)->a( n = `text` v = `{KEY}`
)->end(
)->tag( `Label`
)->a( n = `text` v = `Style`
)->ele( `Select`
)->a( n = `selectedKey` v = client->_bind( style )
)->a( n = `items` v = client->_bind( t_style_types )
)->tag( n = `Item` ns = `core`
)->a( n = `key` v = `{KEY}`
)->a( n = `text` v = `{KEY}`
)->end(
)->end(
)->ele( `OverflowToolbar`
)->a( n = `id` v = `contentTb`
)->a( n = `class` v = `sapUiSmallMarginTop`
" onSelectDesign/onSelectStyle setDesign/setStyle become two-way bound design/style
)->a( n = `design` v = client->_bind( design )
)->a( n = `style` v = client->_bind( style )
)->tag( `Label`
)->a( n = `text` v = `Toolbar content `
" bActionContext (selected design is not Info) is an expression over the bound design
)->tag( `Button`
)->a( n = `text` v = `Action1`
)->a( n = `visible` v = |\{= ${ client->_bind( design ) } !== 'Info' \}|
)->tag( `Button`
)->a( n = `text` v = `Action2`
)->a( n = `visible` v = |\{= ${ client->_bind( design ) } !== 'Info' \}|
)->end(
)->end(
)->end( ).
client->view_display( view->stringify( ) ).
ENDMETHOD.
METHOD model_init.
" keys of sap.m.ToolbarDesign / sap.m.ToolbarStyle in Object.keys order (library.js declaration order)
t_design_types = VALUE #( ( key = `Auto` ) ( key = `Transparent` ) ( key = `Info` ) ( key = `Solid` ) ).
t_style_types = VALUE #( ( key = `Standard` ) ( key = `Clear` ) ).
design = `Auto`.
style = `Standard`.
ENDMETHOD.
ENDCLASS.
More in sap.m
- Toggle Button — Toggle Buttons can be toggled between pressed and normal state.
- Pull To Refresh — With the Pull to Refresh you can trigger an update operation by swiping the current page…
- Slide Tile — Shows Generic Tile with the 2x1 frame type displayed as sliding tiles.
- Standard List Item - Avatar — This list item offers a standardized user interface for list content with title, descript…
- URL Helper — The URL Helper can be used to easily trigger a phone's native apps like Email, Telephone…
- Basic Tokenizer — Basic Tokenizer with tokens
- Fiori Object Page - Standard Classes — This page implements the same sample as in 'Fiori Sample Page - sapUiFioriObjectPage' usi…
- Dialog with Search Field — Use a Search Field inside a Dialog.
- Time Picker - Open by Another Control — This example demonstrates the Time Picker that is opened by another control.
- Table - Auto popin of the table columns — This example demonstrates the automatic pop-in behavior of the table and hiding columns i…
- Tab Container — The sap.m.TabContainer allows for working with multiple tabs.
- Popover Controlling Closing Behavior — In some cases the closing behavior of the Popover can lead to drill down navigation. This…
On this page