Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Visibility expressions on panels in AEM

Avatar

Level 1

Hi all,

 
I am new to using AEM and have a questioning around how i use visibility expressions to display panels properly.
 
In my current form, there are a series of branching questions, beginning with a basic optA/ optB radio question. Each panel that is displayed from there contains another radio question and its visibility is conditional on the selection made on the radio question in the previous panel.
 
EG 
MasterRadio -> pathA or pathB, user selects pathA
PanelA1 shows
RadioA1 -> Y/N, if Y show PanelA2
PanelA2 shows
RadioA2 -> Y/N, if Y show PanelA3
Panel A3 shows
RadioA3 -> Y/N, if Y show EndPanel
 
 
MasterRadio -> pathA or pathB, user selects pathB
PanelB1 shows
RadioB1 -> Y/N, if Y show PanelB2
PanelB2 shows
RadioB2 -> Y/N, if Y show PanelB3
PanelB3 shows
RadioB3 -> Y/N, if Y show EndPanel
 
If any Radio = N, show EndPanel
 
This works fine on the initial pass through of the form, provided the user does not go back and change the initial pathway.
 
Example scenario
The user selects pathA, they get to the point where they select Yes on RadioA2 - this makes the PanelA3 containing RadioA3 visible. They then go back and change their initial selection to pathB, they progress along pathB until they get to PanelB2 and RadioB2. They select Yes on RadioB2, expecting to PanelB3 and RadioB3 to display next. Before this reaching this panel however, we are shown PanelA3 and RadioA3 that we had selected previously.
 
In short, we progress down one conditional chain, before going back and changing the initial direction of the chain - the selections made initially on pathA are retained, and they are still visible due to them being completely unrelated to the new conditionals on pathB.
 
How do I structure my visibility expressions to ensure that the user doesn't get presented panels unrelated to their pathway like this? What visibility expressions need to go on panels and what on the components themselves? Any help is much appreciated.
 
Apologies for the essay, I hope this isn't as hard to understand as it was to try and put into words!
1 Accepted Solution

Avatar

Correct answer by
Level 4

Please try these links - The second on is specific example on syntax of your expressions.

/Kanwal

View solution in original post

1 Reply

Avatar

Correct answer by
Level 4

Please try these links - The second on is specific example on syntax of your expressions.

/Kanwal