Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

For Loop

Avatar

Not applicable
There has to be an easier way to write this code (which does work). Would a for loop do it? And if so - how?



if (AddressIntEField.rawValue !=null) {

AddressIntEField.presence = "visible", relevant="+print";

RadioButtonList.rawValue = "2";

}

if (AddressIntDField.rawValue !=null) {

AddressIntDField.presence = "visible", relevant="+print";

AddressDField.presence = "invisible", relevant="+print";

RadioButtonList.rawValue = "2";

}

if (AddressIntCField.rawValue !=null) {

AddressIntCField.presence = "visible", relevant="+print";

AddressCField.presence = "invisible", relevant="+print";

RadioButtonList.rawValue = "2";

}

if (AddressIntBField.rawValue !=null) {

AddressIntBField.presence = "visible", relevant="+print";

AddressBField.presence = "invisible", relevant="+print";

RadioButtonList.rawValue = "2";

}

else {

RadioButtonList.rawValue = "1";

AddressIntEField.presence = "invisible", relevant="+print";

AddressIntDField.presence = "invisible", relevant="+print";

AddressIntCField.presence = "invisible", relevant="+print";

AddressIntBField.presence = "invisible", relevant="+print";

}
0 Replies

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now