Time Picker Sliders
TimePickerSliders used in a Dialog.
Z2UI5_CL_SMPC_APP_095
Controls
sap.m
UI5 1.71
The facts
- Repository
- abap2UI5/samples-controls
- Class
Z2UI5_CL_SMPC_APP_095- Source file
z2ui5_cl_smpc_app_095.clas.abap↗- Library
- sap.m
- UI5 entity
sap.m.TimePickerSliders- Demo kit sample
sap.m.sample.TimePickerSliders- 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: timepickersliders, time, picker, sliders, sap.m, pick, vbox, button, text, dialog
Controls it builds
- sap.m.Button
- sap.m.Dialog
- sap.m.Page
- sap.m.Text
- sap.m.TimePickerSliders
- sap.m.VBox
- sap.ui.core.FragmentDefinition
- 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_095.clas.abap — 120 lines
Click a number to link to a line — shift-click for a range.
Read it on GitHub ↗
" @keywords timepickersliders time picker sliders sap.m pick vbox button text dialog
" @summary TimePickerSliders used in a Dialog.
CLASS z2ui5_cl_smpc_app_095 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
DATA result_text TYPE string VALUE `change event result`.
DATA time_value TYPE string.
PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.
DATA time_value_old TYPE string.
METHODS view_display.
METHODS on_event.
METHODS popup_display.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_smpc_app_095 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 = `height` v = `100%`
)->ele( `Page`
)->a( n = `showHeader` v = `false`
)->ele( `VBox`
)->tag( `Button`
)->a( n = `press` v = client->_event( `OPEN_DIALOG` )
)->a( n = `text` v = `Open Dialog`
)->a( n = `class` v = `sapUiSmallMargin`
)->tag( `Text`
)->a( n = `id` v = `T1`
)->a( n = `text` v = client->_bind( result_text )
)->a( n = `class` v = `sapUiSmallMargin` ).
client->view_display( view->stringify( ) ).
ENDMETHOD.
METHOD on_event.
CASE client->get_event( ).
WHEN `OPEN_DIALOG`.
" capture the current value on open (the original's attachAfterOpen)
time_value_old = time_value.
popup_display( ).
WHEN `OK_PRESS`.
" the static id 'TPS2' stands in for the original's runtime oTP.getId()
result_text = |TimePickerSliders TPS2: { time_value }|.
client->popup_destroy( ).
WHEN `CANCEL_PRESS`.
time_value = time_value_old.
client->popup_destroy( ).
ENDCASE.
ENDMETHOD.
METHOD popup_display.
DATA(popup) = z2ui5_cl_ui5_view_builder=>factory( ).
popup->ele( n = `FragmentDefinition` ns = `core`
)->a( n = `xmlns` v = `sap.m`
)->a( n = `xmlns:core` v = `sap.ui.core`
)->ele( `Dialog`
)->a( n = `id` v = `selectTimeDialog`
)->a( n = `title` v = `Select New Time`
)->tag( `TimePickerSliders`
)->a( n = `id` v = `TPS2`
)->a( n = `valueFormat` v = `hh:mm a`
)->a( n = `displayFormat` v = `hh:mm a`
)->a( n = `height` v = `400px`
" value two-way bound to transport the picked time (original reads oTP.getValue())
)->a( n = `value` v = client->_bind( time_value )
)->ele( `buttons`
)->tag( `Button`
)->a( n = `text` v = `OK`
)->a( n = `press` v = client->_event( `OK_PRESS` )
)->a( n = `type` v = `Emphasized`
)->tag( `Button`
)->a( n = `text` v = `Cancel`
)->a( n = `press` v = client->_event( `CANCEL_PRESS` ) ).
client->popup_display( popup->stringify( ) ).
ENDMETHOD.
ENDCLASS.
More in sap.m
- 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…
- SplitContainer standard use case — SplitContainer maintains two NavContainers if running on tablet or desktop and one NavCon…
- SplitApp standard use case — The SplitApp is the base for each master detail application. It extends the sap.m.SplitCo…
- 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.
On this page