From 6b043b8939e8a28f084343ac18d904a9de0e521c Mon Sep 17 00:00:00 2001 From: Rishi Mehta Date: Tue, 16 Jul 2024 13:07:22 +0530 Subject: [PATCH 1/3] Fixing incorrect id issue with checkbox --- .../fd/components/form/checkbox/v1/checkbox/checkbox.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/checkbox/v1/checkbox/checkbox.html b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/checkbox/v1/checkbox/checkbox.html index f5316ce0dc..5de9e1ea2a 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/checkbox/v1/checkbox/checkbox.html +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/checkbox/v1/checkbox/checkbox.html @@ -30,7 +30,7 @@ data-cmp-enabled="${checkbox.enabled ? 'true' : 'false'}" data-cmp-required="${checkbox.required ? 'true': 'false'}" data-cmp-data-layer="${checkbox.data.json}" - data-sly-test.widgetId="${'{0}-{1}' @ format=[component.id, '_widget']}" + data-sly-test.widgetId="${'{0}-{1}' @ format=[checkbox.id, 'widget']}" data-cmp-adaptiveformcontainer-path="${formstructparser.formContainerPath}">
@@ -38,7 +38,7 @@
Date: Tue, 16 Jul 2024 13:24:40 +0530 Subject: [PATCH 2/3] updating component readme --- .../components/form/textinput/v1/textinput/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/textinput/v1/textinput/README.md b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/textinput/v1/textinput/README.md index b76b834337..d2fbacfb29 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/textinput/v1/textinput/README.md +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/textinput/v1/textinput/README.md @@ -42,6 +42,16 @@ The following properties are written to JCR for this Form Text component and are 8. `./readOnly` - if set to `true`, the filed will be read only 9. `./maxLength` - defines the maximum length of input allowed for the field. 10. `./minLength` - defines the minimum length of input allowed for the field. +11. `./maxLengthMessage` - defines the maximum length error message for the field. +12. `./minLengthMessage` - defines the minimum length error message for the field. + + +### Handling `maxLength` and `maxLengthMessage` in Custom Widgets + +The `maxLength` property in HTML5 compliant fields, such as those used in the Adaptive Form Text Input component, restricts users from typing more characters than specified. This restriction aligns with HTML5 standards to ensure the input length does not exceed the defined maximum. However, there are scenarios, particularly in custom widgets or headless implementations, where it might be necessary to allow input beyond the `maxLength`. + +To accommodate such use-cases, while still adhering to HTML5 compliance within the core component, the `maxLengthMessage` property is provided. This property allows developers to define a custom error message that is displayed when the input exceeds the `maxLength`, offering a way to guide users even when custom logic permits them to enter more characters than the standard limit. + ## Client Libraries The component provides a `core.forms.components.textinput.v1.runtime` client library category that contains the Javascript runtime for the component. From fb737c2c334734d75924b67132063b0aa08af7af Mon Sep 17 00:00:00 2001 From: Rishi Mehta Date: Tue, 16 Jul 2024 13:26:05 +0530 Subject: [PATCH 3/3] updating read me --- .../core/fd/components/form/textinput/v1/textinput/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/textinput/v1/textinput/README.md b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/textinput/v1/textinput/README.md index d2fbacfb29..115c38d857 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/textinput/v1/textinput/README.md +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/textinput/v1/textinput/README.md @@ -46,7 +46,7 @@ The following properties are written to JCR for this Form Text component and are 12. `./minLengthMessage` - defines the minimum length error message for the field. -### Handling `maxLength` and `maxLengthMessage` in Custom Widgets +### Behavior of `maxLength` and `maxLengthMessage` The `maxLength` property in HTML5 compliant fields, such as those used in the Adaptive Form Text Input component, restricts users from typing more characters than specified. This restriction aligns with HTML5 standards to ensure the input length does not exceed the defined maximum. However, there are scenarios, particularly in custom widgets or headless implementations, where it might be necessary to allow input beyond the `maxLength`.