Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Change fill of text object depending on radio button selection


Level 1


This should be fairly easy for most of you to answer. I am trying to fill one of two text objects depending on the radio button selection. Here is the code I have

If (RadioButtonList.Value == "Accept")

TextAccept.border.fill.color.value == "255,255,0";

else TextDoNotAccept.border.fill.color.value == "255,255,0";

Don't know why this is not working but I'm sure one of you will figure it out quickly.

Thanks in advance!

1 Reply


Level 10

You've got a few mistakes...Value should be rawValue for RadioButtonList.

There should only be 1 equals signs for the color assignment statements. "=" assigns a value, "==" tests a value.

And then it's always a good idea to put in the curly braces, althought I think for single statements it will work without them.

If (RadioButtonList.rawValue == "Accept") {

          TextAccept.border.fill.color.value = "255,255,0";


else {

          TextDoNotAccept.border.fill.color.value = "255,255,0";