SplitApp standard use case
The SplitApp is the base for each master detail application. It extends the sap.m.SplitContainer control.
Z2UI5_CL_SMPC_APP_097
Controls
sap.m
UI5 1.71
The facts
- Repository
- abap2UI5/samples-controls
- Class
Z2UI5_CL_SMPC_APP_097- Source file
z2ui5_cl_smpc_app_097.clas.abap↗- Library
- sap.m
- UI5 entity
sap.m.SplitApp- Demo kit sample
sap.m.sample.SplitApp- 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: splitapp, split, app, sap.m, master-detail, navigation, label, button, vbox, text, radiobuttongroup, radiobutton
Controls it builds
- sap.m.Button
- sap.m.Input
- sap.m.Label
- sap.m.List
- sap.m.Page
- sap.m.RadioButton
- sap.m.RadioButtonGroup
- sap.m.SplitApp
- sap.m.StandardListItem
- sap.m.Text
- sap.m.VBox
- 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_097.clas.abap — 212 lines
Click a number to link to a line — shift-click for a range.
Read it on GitHub ↗
" @keywords splitapp split app sap.m master-detail navigation label button vbox text radiobuttongroup radiobutton
" @summary The SplitApp is the base for each master detail application. It extends the sap.m.SplitContainer control.
CLASS z2ui5_cl_smpc_app_097 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
DATA mode_idx TYPE i.
DATA mode TYPE string VALUE `ShowHideMode`.
PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.
METHODS view_display.
METHODS on_event.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_smpc_app_097 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:custom` v = `http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1`
)->ele( `SplitApp`
)->a( n = `id` v = `SplitAppDemo`
)->a( n = `mode` v = client->_bind( mode )
)->a( n = `initialDetail` v = `detail`
)->a( n = `initialMaster` v = `master`
)->ele( `detailPages`
)->ele( `Page`
)->a( n = `id` v = `detail`
)->a( n = `title` v = `Detail 1`
)->a( n = `backgroundDesign` v = `Solid`
)->tag( `Label`
)->a( n = `text` v = `Detail page 1`
)->tag( `Button`
)->a( n = `text` v = `Go to Detail page2`
)->a( n = `press` v = client->_event( `NAV_TO_DETAIL` )
)->end(
)->ele( `Page`
)->a( n = `id` v = `detailDetail`
)->a( n = `title` v = `Detail Detail`
)->a( n = `backgroundDesign` v = `Solid`
)->a( n = `showNavButton` v = `true`
)->a( n = `navButtonPress` v = client->_event( `DETAIL_BACK` )
)->ele( `VBox`
)->a( n = `class` v = `sapUiSmallMargin`
)->tag( `Label`
)->a( n = `text` v = `This is Detail Page2`
)->tag( `Text`
)->a( n = `text` v = `Here you could change the Split Application mode. After the mode change, resize the browser window to see the difference in the master form behaviour.`
)->ele( `RadioButtonGroup`
)->a( n = `columns` v = `1`
)->a( n = `width` v = `500px`
)->a( n = `class` v = `sapUiMediumMarginBottom`
)->a( n = `selectedIndex` v = client->_bind( mode_idx )
)->a( n = `select` v = client->_event( `MODE_BTN` )
)->tag( `RadioButton`
)->a( n = `id` v = `RB1-1`
)->a( n = `text` v = `show/hide`
)->a( n = `selected` v = `true`
)->a( n = `custom:splitAppMode` v = `ShowHideMode`
)->tag( `RadioButton`
)->a( n = `id` v = `RB1-2`
)->a( n = `text` v = `stretch/compress`
)->a( n = `custom:splitAppMode` v = `StretchCompressMode`
)->tag( `RadioButton`
)->a( n = `id` v = `RB1-3`
)->a( n = `text` v = `hide`
)->a( n = `custom:splitAppMode` v = `HideMode`
)->tag( `RadioButton`
)->a( n = `id` v = `RB1-4`
)->a( n = `text` v = `popover`
)->a( n = `custom:splitAppMode` v = `PopoverMode`
)->end(
)->end(
)->end(
)->ele( `Page`
)->a( n = `id` v = `detail2`
)->a( n = `title` v = `Detail 3 Page`
)->a( n = `backgroundDesign` v = `Solid`
)->a( n = `showNavButton` v = `true`
)->a( n = `navButtonPress` v = client->_event( `DETAIL_BACK` )
)->tag( `Label`
)->a( n = `text` v = `This is Detail Page3`
)->tag( `Input`
)->tag( `Label`
)->a( n = `text` v = `Label 2`
)->tag( `Input`
)->tag( `Label`
)->a( n = `text` v = `Label 3`
)->tag( `Input`
)->tag( `Label`
)->a( n = `text` v = `Label 4`
)->tag( `Input`
)->tag( `Label`
)->a( n = `text` v = `Label 5`
)->tag( `Input`
)->end(
)->end(
)->ele( `masterPages`
)->ele( `Page`
)->a( n = `id` v = `master`
)->a( n = `title` v = `Master 1`
)->a( n = `backgroundDesign` v = `List`
)->ele( `List`
)->tag( `StandardListItem`
)->a( n = `title` v = `To Master2`
)->a( n = `type` v = `Navigation`
)->a( n = `press` v = client->_event( `GO_TO_MASTER` )
)->end(
)->end(
)->ele( `Page`
)->a( n = `id` v = `master2`
)->a( n = `title` v = `Master 2`
)->a( n = `backgroundDesign` v = `List`
)->a( n = `showNavButton` v = `true`
)->a( n = `navButtonPress` v = client->_event( `MASTER_BACK` )
)->ele( `List`
)->tag( `StandardListItem`
)->a( n = `title` v = `To Detail 1`
)->a( n = `type` v = `Active`
)->a( n = `custom:to` v = `detail`
)->a( n = `press` v = client->_event( val = `NAV_DETAIL` arg = `detail` )
)->tag( `StandardListItem`
)->a( n = `title` v = `To Detail 2`
)->a( n = `type` v = `Active`
)->a( n = `custom:to` v = `detailDetail`
)->a( n = `press` v = client->_event( val = `NAV_DETAIL` arg = `detailDetail` )
)->tag( `StandardListItem`
)->a( n = `title` v = `To Detail 3`
)->a( n = `type` v = `Active`
)->a( n = `custom:to` v = `detail2`
)->a( n = `press` v = client->_event( val = `NAV_DETAIL` arg = `detail2` ) ).
client->view_display( view->stringify( ) ).
ENDMETHOD.
METHOD on_event.
CASE client->get_event( ).
WHEN `NAV_TO_DETAIL`.
client->follow_up_action( val = client->cs_event-control_by_id
t_arg = VALUE #( ( `SplitAppDemo` ) ( `to` ) ( `detailDetail` ) ) ).
WHEN `DETAIL_BACK`.
client->follow_up_action( val = client->cs_event-control_by_id
t_arg = VALUE #( ( `SplitAppDemo` ) ( `backDetail` ) ) ).
WHEN `MASTER_BACK`.
client->follow_up_action( val = client->cs_event-control_by_id
t_arg = VALUE #( ( `SplitAppDemo` ) ( `backMaster` ) ) ).
WHEN `GO_TO_MASTER`.
client->follow_up_action( val = client->cs_event-control_by_id
t_arg = VALUE #( ( `SplitAppDemo` ) ( `toMaster` ) ( `master2` ) ) ).
WHEN `NAV_DETAIL`.
client->follow_up_action( val = client->cs_event-control_by_id
t_arg = VALUE #( ( `SplitAppDemo` ) ( `toDetail` ) ( client->get_event_arg( ) ) ) ).
WHEN `MODE_BTN`.
" the original calls setMode( ); mode is a bindable property, so it is
" bound two-way and only assigned here
mode = SWITCH string( mode_idx
WHEN 0 THEN `ShowHideMode`
WHEN 1 THEN `StretchCompressMode`
WHEN 2 THEN `HideMode`
WHEN 3 THEN `PopoverMode` ).
client->message_toast_display( text = |Split Container mode is changed to: { mode }| duration = `5000` ).
ENDCASE.
ENDMETHOD.
ENDCLASS.
More in sap.m
- 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…
- Time Picker Sliders — TimePickerSliders used in a Dialog.
- SplitContainer standard use case — SplitContainer maintains two NavContainers if running on tablet or desktop and one NavCon…
- View Settings Dialog - Standard — The View Settings Dialog is a standard UI pattern for specifying sorting, grouping and fi…
- QuickViewCard — QuickViewCard embedded in container
- QuickView — QuickView basic samples.
- Wizard standard use case — The Wizard is useful for breaking down complex tasks into smaller steps.
- Late Model Update — The sample demonstrates how to rebind a control to a different data source after a certai…
- Select Dialog — The Select Dialog allows the user to search for and pick an item from a possibly long opt…
On this page