Keymaster
9 months, 1 week 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 9 months, 1 week ago by
Chris Bouveret.