Dynamic Date Range - Open by Another Control
This example shows Dynamic Date Range which is opened by another control.
Z2UI5_CL_SMPC_APP_641
Controls
sap.m
UI5 1.105
The facts
- Repository
- abap2UI5/samples-controls
- Class
Z2UI5_CL_SMPC_APP_641- Source file
z2ui5_cl_smpc_app_641.clas.abap↗- Library
- sap.m
- UI5 entity
sap.m.DynamicDateRange- Demo kit sample
sap.m.sample.DynamicDateRangeHidden- SAP's own sample
- running at sdk.openui5.org ↗
- Minimum UI5
- 1.105
- In the playground
- runs in the browser, with no system and nothing installed
Keywords: dynamicdaterange, dynamic, date, range, sap.m, dynamicdaterangehidden, title, vbox, label, button, link
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_641.clas.abap — 111 lines
Click a number to link to a line — shift-click for a range.
Read it on GitHub ↗
" @keywords dynamicdaterange dynamic date range sap.m dynamicdaterangehidden title vbox label button link
" @summary This example shows Dynamic Date Range which is opened by another control.
" @origin sap.m.sample.DynamicDateRangeHidden - https://sdk.openui5.org/entity/sap.m.DynamicDateRange/sample/sap.m.sample.DynamicDateRangeHidden (status: generated - machine-written, not yet reviewed)
CLASS z2ui5_cl_smpc_app_641 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.
METHODS view_display.
METHODS on_event.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_smpc_app_641 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:mvc` v = `sap.ui.core.mvc`
)->a( n = `xmlns` v = `sap.m`
)->tag( `Title`
)->a( n = `class` v = `sapUiSmallMargin`
)->a( n = `text` v = `Open Dynamic Date Range by Another Control`
)->ele( `VBox`
)->a( n = `class` v = `sapUiSmallMargin`
)->tag( `Label`
)->a( n = `text` v = `By Button with text`
)->tag( `Button`
)->a( n = `ariaHasPopup` v = `Dialog`
)->a( n = `text` v = `Open Dynamic Date Range`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_by_id t_arg = VALUE #( ( `HiddenDDR` ) ( `openBy` ) ( `$event.oSource.sId` ) ) )
)->end(
)->ele( `VBox`
)->a( n = `class` v = `sapUiSmallMargin`
)->tag( `Label`
)->a( n = `text` v = `By Button with icon`
)->tag( `Button`
)->a( n = `ariaHasPopup` v = `Dialog`
)->a( n = `tooltip` v = `Open Dynamic Date Range`
)->a( n = `icon` v = `sap-icon://check-availability`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_by_id t_arg = VALUE #( ( `HiddenDDR` ) ( `openBy` ) ( `$event.oSource.sId` ) ) )
)->end(
)->ele( `VBox`
)->a( n = `class` v = `sapUiSmallMargin`
)->tag( `Label`
)->a( n = `text` v = `By Link`
)->tag( `Link`
)->a( n = `ariaHasPopup` v = `Dialog`
)->a( n = `text` v = `Open Dynamic Date Range`
)->a( n = `press` v = client->follow_up_action( val = client->cs_event-control_by_id t_arg = VALUE #( ( `HiddenDDR` ) ( `openBy` ) ( `$event.oSource.sId` ) ) )
)->end(
" the values travel as the original's string concatenation renders them (a Date as its toString)
)->tag( `DynamicDateRange`
)->a( n = `id` v = `HiddenDDR`
)->a( n = `hideInput` v = `true`
)->a( n = `change` v = client->_event( val = `CHANGE`
t_arg = VALUE #( ( `${$parameters>/value/operator}` )
( `${$parameters>/value/values}.length` )
( `${$parameters>/value/values/0} + ''` )
( `${$parameters>/value/values/1} + ''` ) ) ) ).
client->view_display( view->stringify( ) ).
ENDMETHOD.
METHOD on_event.
IF client->get_event( ) = `CHANGE`.
" changeDateHandler - the toast text is composed here, one line per value
DATA(output) = |\nOperator: { client->get_event_arg( ) }|.
DATA(count) = CONV i( client->get_event_arg( 2 ) ).
IF count >= 1.
output = |{ output }\nValue 1: { client->get_event_arg( 3 ) }|.
ENDIF.
IF count >= 2.
output = |{ output }\nValue 2: { client->get_event_arg( 4 ) }|.
ENDIF.
client->message_toast_display( |Selected: \n{ output }| ).
ENDIF.
ENDMETHOD.
ENDCLASS.
More in sap.m
- Illustrated Message in a Page with Configurable Properties (Custom Illustration Set) — The available properties of the IllustratedMessage are configurable in this sample. The a…
- Illustrated Message in a Page with Configurable Properties (TNT Illustration Set) — The available properties of the IllustratedMessage are configurable in this sample. The a…
- Illustrative style illustrations using the 'src' property — The available illustrations are from the default illustration set with the use of the 'sr…
- Illustrated Message Session Timeout — All applications that require user sign-in should employ a mechanism for automating user…
- Dynamic Date Range — The dynamic date range is a control that offers a choice of absolute and relative dates…
- Dynamic Date Range with calendarWeekNumbering — This example shows the Dynamic Date Range control with Middle Eastern calendar week numbe…
- Dynamic Date Range with Custom Options — This example shows the Dynamic Date Range control with custom options for interval or dat…
- Expandable Text — The ExpandableText control can be used to display a larger texts inside a table, list or…
- p13n.Container usage in a Dialog/Popover — Dialog & Popover with a sap.m.P13nContainer as content.
- Personalization for responsive table — Responsive Table using the personalization Engine
- Personalization implementing custom filter controls — Filtering using the personalization Engine
- Personalization for grid list — GridList using the personalization Engine
On this page