From dc0de5efbbd13f490177e8da8284464169298015 Mon Sep 17 00:00:00 2001 From: Rishi Mehta Date: Tue, 17 Dec 2024 10:21:31 +0530 Subject: [PATCH 1/2] Sample for help text in individual radio button --- .../models/v1/form/RadioButtonImpl.java | 8 +++++ .../v1/radiobutton/radiobutton.html | 35 ++++++++++--------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/RadioButtonImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/RadioButtonImpl.java index 28318f8f1f..c19879e540 100644 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/RadioButtonImpl.java +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/RadioButtonImpl.java @@ -50,6 +50,14 @@ public class RadioButtonImpl extends AbstractOptionsFieldImpl implements RadioBu protected String orientationJcr; private Orientation orientation; + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = ReservedProperties.PN_ORIENTATION) + @Nullable + private String[] helpTexts; + + public String[] getHelpTexts() { + return helpTexts; + } + @PostConstruct private void initRadioButtonModel() { orientation = Orientation.fromString(orientationJcr); diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v1/radiobutton/radiobutton.html b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v1/radiobutton/radiobutton.html index 361f3d1fca..e6df598852 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v1/radiobutton/radiobutton.html +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v1/radiobutton/radiobutton.html @@ -34,25 +34,26 @@ data-cmp-adaptiveformcontainer-path="${formstructparser.formContainerPath}" data-sly-test.widgetId="${'{0}-{1}' @ format=[radioButton.id, 'widget']}">
-
-
+
+
-
-
- -
-
+
+
+ +
+
From 4cf2533e7857beb9297b398af947486fa3b533c6 Mon Sep 17 00:00:00 2001 From: Rishi Mehta Date: Tue, 17 Dec 2024 10:32:08 +0530 Subject: [PATCH 2/2] Adding todo in sling model --- .../components/internal/models/v1/form/RadioButtonImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/RadioButtonImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/RadioButtonImpl.java index c19879e540..a8aea16a18 100644 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/RadioButtonImpl.java +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/RadioButtonImpl.java @@ -50,7 +50,8 @@ public class RadioButtonImpl extends AbstractOptionsFieldImpl implements RadioBu protected String orientationJcr; private Orientation orientation; - @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = ReservedProperties.PN_ORIENTATION) + // todo: inject this by taking this property as input from edit dialog based on the requirement + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL) @Nullable private String[] helpTexts;