SetDisplay causing variable misalignment on Service Portal

KrešimirB
Tera Contributor

Hi,

I've run into a peculiar issue while developing a record producer.

 

We differentiate users by a certain criteria. Depending on this criteria, UI policies (through a script, not UI policy actions) hide or show certain fields on the record producer portal form. For this specific form I am talking about, we have two containers, one called "personal_information1" and the other one called "personal_information2". The first container's variables are all read only, and they represent the current state of data. The second container's variables are editable, and allow the user to input their new desired state. Both containers are set to "2 Columns, alternating sides".

 

In the first container, we have these variables: "Maiden last name" and "Citizenship", as shown:

p1-shown.png

 

When the criteria is not met, "Maiden last name" needs to be hidden. I did this using setDisplay() in a UI policy, however it still leaves a blank space:

p1-hidden.png

 

For the second container, we have the following variables: "First name", "Maiden last name", "Last name", "Citizenship", "2nd citizenship", "3rd citizenship", like this:

p2-shown.png

 

However, when "Maiden last name" is hidden (using setDisplay() on a different UI policy), there is no blank space, but the order gets misaligned:

p2-hidden.png

 

So I would expect, when we hide "Maiden last name" in container 2, that the order goes from this:
First name | Maiden last name
Last name | Citizenship

2nd citizenship | 3rd citizenship

to this:

First name | Last name

Citizenship | 2nd citizenship

3rd citizenship

since it's set to alternating sides.

This is how the second container looks inside the recprod record:

QuestionNameTypeOrder
Personal informationpersonal_information2Container Start5000
First namee_first_nameSingle Line Text5100
Maiden last namee_maiden_nameSingle Line Text5200
Last namee_last_nameSingle Line Text5300
Citizenshipe_citizenshipSelect Box5400
2nd citizenshipe_2nd_citizenshipSelect Box5500
3rd citizenshipe_3rd_citizenshipSelect Box5600
(empty)formatter7Container End5700

 

Does anybody know what might cause this? I quintuple-checked, I only hide variables by using setDisplay(), and it's only in UI policies, not in Catalog Client Scripts. I also don't use ANY UI policy actions, but when I do, nothing changes...

 

Thank you in advance!

2 REPLIES 2

Brad Bowman
Kilo Patron
Kilo Patron

You can try to change the container to one side then the other, add a Container Split type variable, and reorder to define what should be on the left / before or right / after the split.  You could also try a UI Policy action instead of script or Catalog Client Script to see if the results are different.

Hi, and thank you for your response!

I have already tried using UI policy actions and controlling visibility from catalog client scripts, and they unfortunately change nothing 😞

Regarding your Container Split suggestion, could you please go into more detail? I don't know how I would accomplish what I need with Container Splits, I've tried something but it didn't work, just kept variables that were originally on the left to stay on the left, and those on the right to stay on the right.