Keymaster
Has successfully completed the online course Introduction
Has successfully completed the online course Intermediate (200)
Has successfully completed the online course Advanced (300)
Has successfully completed the online course Basics (100)
Has successfully completed the online course Advanced (320)
Has successfully completed the Intermediate Certification
Has successfully completed the Advanced Certification 1 year, 4 months ago
#54186
::
I understand that you want to toggle the Datepicker based on a checkbox. To create this logic follow these steps:
- Add a Checkbox and a Datepicker to your Screen, in this example “Screen1”
- Create a variable called “checkboxState” of type boolean in Data Workbench
- Create a Story e.g. “Enable DatePicker by Checkbox”
- Subscribe to the select Event of your Checkbox
- Add a Script with
// Get the current state of the checkBox var checkboxState = sap.ui.getCore().byId("Screen1--CheckBox").mProperties.selected; // Set current state as variable this.getGlobals().setVar("checkboxState", checkboxState); - Add a UI Action and map the variable “checkboxState” to the “enabled” property of your DatePicker
- Deploy Your App and see the result 🙂
Hi, please also see the attached Screenshot. Hope this helps
Best Regards
Chris
-
This reply was modified 1 year, 4 months ago by
Chris Bouveret.