Hi,
Can you add the input IsMandatory, that is standard of most of the fields in Outsystems ?
Is there a way to add a clear button ? And a OnClear event ?
Many thx,
Stephane
Hi Stephane,
1. IsMandatory Support
By default, OutSystems input widgets expose IsMandatory because they’re tied to form validation.
The Week Picker component (being a custom/reactive component) doesn’t automatically inherit that.
To achieve the same, you can:
Add an Input Parameter called IsMandatory in the component.
Inside, apply OutSystems’ Validation API (using Form.Valid, Form.Validate()) or show an inline message if no value is selected.
This way it behaves consistently with other inputs in a form.
2. Clear Button
A common approach is to add a small icon (e.g., "x") inside the input group.
On click ---> set the component’s bound variable to NullDate().
That visually clears the field, just like other OutSystems pickers.
3. OnClear Event
You can expose a custom Output Event from the component, e.g. OnClear.
When the user clicks the clear icon, trigger that event.
Consumers of the component can then attach their logic (resetting related fields, re-fetching data, etc.).
So yes, all three are possible:
IsMandatory → add as input param + integrate with Form validation.
Clear button → small UI addition bound to reset value.
OnClear → expose as event in the component.
Sorry for my late reply. I've just uploaded a new version of the component that supports clearing the date picker. That was already possible, but I've improved it by adding a OnClear event. This way clearing the date picker can be handled properly. See the demo for more info.
Like Neeraj said, since this isn't a managed form input, adding a IsMandatory isn't really feasible. However, you can always build your own validations and display error messages of course.