Date Range Selection - Value States
This example shows different DateRangeSelection value states.
Z2UI5_CL_SMPC_APP_254
Controls
sap.m
UI5 1.71
The facts
- Repository
- abap2UI5/samples-controls
- Class
Z2UI5_CL_SMPC_APP_254- Source file
z2ui5_cl_smpc_app_254.clas.abap↗- Library
- sap.m
- UI5 entity
sap.m.DateRangeSelection- Demo kit sample
sap.m.sample.DateRangeSelectionValueState- 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: daterangeselection, date, range, selection, sap.m, daterangeselectionvaluestate, flexbox, vbox, label
Controls it builds
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_254.clas.abap — 82 lines
Click a number to link to a line — shift-click for a range.
Read it on GitHub ↗
" @keywords daterangeselection date range selection sap.m daterangeselectionvaluestate flexbox vbox label
" @summary This example shows different DateRangeSelection value states.
CLASS z2ui5_cl_smpc_app_254 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
TYPES:
BEGIN OF ty_s_row,
label TYPE string,
valuestate TYPE string,
valuestatetext TYPE string,
END OF ty_s_row.
DATA modeldata TYPE STANDARD TABLE OF ty_s_row WITH EMPTY KEY.
PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.
METHODS view_display.
METHODS model_init.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_smpc_app_254 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 = `xmlns:mvc` v = `sap.ui.core.mvc`
)->a( n = `xmlns` v = `sap.m`
)->ele( `FlexBox`
)->a( n = `items` v = |\{ path: '{ client->_bind_path( modeldata ) }' \}|
)->a( n = `direction` v = `Column`
)->ele( `VBox`
)->a( n = `class` v = `sapUiTinyMargin`
)->tag( `Label`
)->a( n = `text` v = `{LABEL}`
)->tag( `DateRangeSelection`
)->a( n = `delimiter` v = `–`
)->a( n = `width` v = `100%`
)->a( n = `valueState` v = `{VALUESTATE}`
)->a( n = `valueStateText` v = `{VALUESTATETEXT}` ).
client->view_display( view->stringify( ) ).
ENDMETHOD.
METHOD model_init.
" onInit's aData 1:1 - every row carries a valueState (no absent-enum
" trap); the rows without a valueStateText keep the empty default
modeldata = VALUE #(
( label = `DateRangeSelection with valueState None` valuestate = `None` )
( label = `DateRangeSelection with valueState Information` valuestate = `Information` )
( label = `DateRangeSelection with valueState Success` valuestate = `Success` )
( label = `DateRangeSelection with valueState Warning and long valueStateText` valuestate = `Warning`
valuestatetext = `Warning message. This is an extra long text used as a warning message. It illustrates how the text wraps into two or more lines without truncation to show the full length of the message.` )
( label = `DateRangeSelection with valueState Error` valuestate = `Error` ) ).
ENDMETHOD.
ENDCLASS.
More in sap.m
- Responsive Popover — The Responsive Popover is an abstraction of Popover and Dialog. On the phone a Dialog wil…
- Button with Badge — Button with a Badge attached
- Color Palette as popover — The ColorPalette in a popover (by use of thin wrapper control sap.m.ColorPalettePopover).
- Busy Dialog - Light — This is a 'light' version of the standard Busy Dialog; it also blocks the user interface…
- Carousel with Multiple Items at Once — The customLayout aggregation determines how many pages are displayed in Carousel's visibl…
- Date Picker - Value States — This example shows different DatePicker value states.
- Date Time Picker - Value States — This example shows different DateTimePicker value states.
- Date Range Selection - Open by Another Control — This example shows Date Range Selection which is opened by another control.
- Date Time Picker - Open by Another Control — This example shows Date Time Picker which is opened by another control.
- Message Dialog — Creating a dialog for showing UI messages. The possible messages types are: 'None', 'Succ…
- Dialog - Fullscreen — A dialog that can be toggled to fullscreen mode through a header button, by double-clicki…
- Tile Statuses — Shows the GenericTile while it is loading, if loading fails, and in disabled status.
On this page