Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Having different objects appear in the same place according to earlier selection

Avatar

Level 4

Hello,

This is a case where I'm not sure where to start off.  I could easily position some fields around the page that are "hidden" by default and become "visible" if the right option is selected, but my guess is that's a clumsy way of going about it. 

I think I can manage the code (if then) but what type of object should I use? A subform? Fragment? 

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

If there were only a few objects then I would change the presence property of each object individually. If all of the objects have the same presence property then I would place them in a subform and just change the presence of the subform.

There is an example here: http://assure.ly/h7whb8.

Hope that helps,

Niall

View solution in original post

3 Replies

Avatar

Level 4

Ok, so I can just place objects in the same location and adjust their visibility using javascript.  But should I be using a subform? What's the acceptable practice for this?

Avatar

Correct answer by
Level 10

Hi,

If there were only a few objects then I would change the presence property of each object individually. If all of the objects have the same presence property then I would place them in a subform and just change the presence of the subform.

There is an example here: http://assure.ly/h7whb8.

Hope that helps,

Niall

Avatar

Level 10

Hi,

The forums seem to have entered the Bermuda Triangle, with both of our posts yesterday going missing. So I'm reporting...

You are testing the checkbox against a string "true", which it will never be. You could test against a Boolean true without the quotes. 

Also if you select the checkbox and look at the defaults in the Object palette you will see that a checked checkbox has a default value of 1. You should test against this. 

Niall