Coral 3 ui Switch on/off text not working

velmuruganv38

24-07-2019

Hi,

In AEM 6.4 Switch field doesn't show the on/off text even if provided, whereas in AEM6.1 it's working fine.  In adobe documentation also on/off text properties are available. Still not working, any suggestion would be helpful.

Coral doc: Documentation | CoralUI

Adobe doc: Switch — Granite UI 1.0 documentation

Screen Shot 2019-07-24 at 1.06.41 PM.png

AEM 6.4

Screen Shot 2019-07-24 at 12.57.09 PM.png

AEM 6.1

Screen Shot 2019-07-24 at 1.06.00 PM.png

Thanks,

Velu

Accepted Solutions (1)

Accepted Solutions (1)

Arun_Patidar

MVP

24-07-2019

Hi,

It is not working because of a code issue.

There is no code written to show on/off text.

you can simply overlay switch resource type and add below code in switch.jsp in line 234

/apps/granite/ui/components/coral/foundation/form/switch/switch.jsp

<span class="coral3-Switch"><%= offText %></span>

<coral-switch <%= attrs.build() %>></coral-switch>

<span class="coral3-Switch"><%= onText %></span>

Could you please raise a daycare ticket as well to fix it from adobe side?

Answers (4)

Answers (4)

velmuruganv38

24-07-2019

Thank You Guys!

Yes Arun you are right.  Even i don't see the properties listed in the jsp file.  So we can consider that they have removed these properties in coral3.

Regards,

Velmurugan

vipins5188

24-07-2019

Hi Velu,

Please try using textOff & textOn instead of offText & onText.

This should work, we are using switch and its working fine.

Thanks,

Vipin

jbrar

Employee

24-07-2019

Have you tried "labelledBy"

Reference to a space delimited set of ids for the HTML elements that provide a label for the formField. Implementers should override this method to ensure that the appropriate descendant elements are labelled using the aria-labelledby attribute. This will ensure that the component is properly identified for accessibility purposes. It reflects the aria-labelledby attribute to the DOM.

Inherited From:
Default Value:
  • null
HTML Attribute:
  • labelledby