Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Do Not Merge] Sample for help text in individual radio button #1496

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ public class RadioButtonImpl extends AbstractOptionsFieldImpl implements RadioBu
protected String orientationJcr;
private Orientation 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;

public String[] getHelpTexts() {
return helpTexts;
}

@PostConstruct
private void initRadioButtonModel() {
orientation = Orientation.fromString(orientationJcr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,26 @@
data-cmp-adaptiveformcontainer-path="${formstructparser.formContainerPath}"
data-sly-test.widgetId="${'{0}-{1}' @ format=[radioButton.id, 'widget']}">
<div class="cmp-adaptiveform-radiobutton__label-container">
<div data-sly-call="${label.label @componentId=widgetId, labelValue=radioButton.label.value, labelVisible=radioButton.label.visible, labelRichText=radioButton.label.richText, bemBlock='cmp-adaptiveform-radiobutton'}" data-sly-unwrap></div>
<div data-sly-call="${questionMark.questionMark @componentId=radiobutton.id, longDescription=radioButton.description, bemBlock='cmp-adaptiveform-radiobutton'}" data-sly-unwrap></div>
<div data-sly-call="${label.label @componentId=widgetId, labelValue=radioButton.label.value, labelVisible=radioButton.label.visible, labelRichText=radioButton.label.richText, bemBlock='cmp-adaptiveform-radiobutton'}" data-sly-unwrap></div>
<div data-sly-call="${questionMark.questionMark @componentId=radiobutton.id, longDescription=radioButton.description, bemBlock='cmp-adaptiveform-radiobutton'}" data-sly-unwrap></div>
</div>
<div class="cmp-adaptiveform-radiobutton__widget ${radioButton.orientation}" id="${widgetId}" role="radiogroup">
<div data-sly-list="${radioButton.enums}" data-sly-unwrap>
<div class="cmp-adaptiveform-radiobutton__option">
<label class="cmp-adaptiveform-radiobutton__option-label"
title="${radioButton.tooltipVisible ? '' : radioButton.tooltipText}">
<input type="radio"
name="${radioButton.name}"
class="cmp-adaptiveform-radiobutton__option__widget"
value="${item.toString}"
disabled="${!radioButton.enabled || radioButton.readOnly}"
checked="${radioButton.enums[itemList.index] == radioButton.default[0]}"
/>
<span>${radioButton.enumNames[itemList.index] @ context = 'html'}</span>
</label>
</div>
</div>
<div data-sly-list="${radioButton.enums}" data-sly-unwrap>
<div class="cmp-adaptiveform-radiobutton__option">
<label class="cmp-adaptiveform-radiobutton__option-label"
title="${radioButton.tooltipVisible ? '' : radioButton.tooltipText}">
<input type="radio"
name="${radioButton.name}"
class="cmp-adaptiveform-radiobutton__option__widget"
value="${item.toString}"
disabled="${!radioButton.enabled || radioButton.readOnly}"
checked="${radioButton.enums[itemList.index] == radioButton.default[0]}"
/>
<span>${radioButton.enumNames[itemList.index] @ context = 'html'}</span>
<div data-sly-call="${questionMark.questionMark @componentId=widgetId, longDescription=radioButton.helpTexts[itemList.index], bemBlock='cmp-adaptiveform-radiobutton__option'}" data-sly-unwrap></div>
</label>
</div>
</div>
</div>
<div data-sly-call="${shortDescription.shortDescription @componentId=radiobutton.id, shortDescriptionVisible=radioButton.tooltipVisible, shortDescription=radioButton.tooltip, bemBlock='cmp-adaptiveform-radiobutton'}" data-sly-unwrap></div>
<div data-sly-call="${longDescription.longDescription @componentId=radiobutton.id, longDescription=radioButton.description, bemBlock='cmp-adaptiveform-radiobutton'}" data-sly-unwrap></div>
Expand Down
Loading