Controlling Views
  • 24 Aug 2021
  • 1 Minute to read
  • Contributors
  • Dark
    Light

Controlling Views

  • Dark
    Light

Article summary

Controlling views

 

Segment visibility

In the Portlet builder, you can see the property segment visibility on a segment. It can have the values:

 

  • Visible
  • Hidden
  • data controlled

 

 

Visible = the segment shall be visible

Hidden= the segment shall not be visible (don’t mix this with the state collapsed of a visible segment)

Data controlled = if there is no data in the simple model that is pinpointed in the”Controlling simple model” –property, the segment shall not be rendered. 

 

You can override these properties from a rule, by accessing the methods in RenderModel shown in the script below:

 

public static String SEGMENT_VISIBILITY_HIDDEN="hidden";

            public static String SEGMENT_VISIBILITY_VISIBLE="visible";

            public static String SEGMENT_VISIBILITY_DATA_CONTROLLED="data controlled";

            

            public void setSegmentVisabilityBySegId(String segmentId, String visibility) {

                        Element seg = getSegmentNodeById(segmentId);

                        setSegmentVisibility(seg, visibility);

            }

            

            public void setSegmentVisabilityByLogicalId(String logicalId, String visibility) {

                        List segList = getSegmentsByLogicId(logicalId);

                        for(Iterator itr = segList.iterator(); itr.hasNext();) {

                                    Element elm = (Element)itr.next();

                                    setSegmentVisibility(elm, visibility);

                        }

            }

 

 


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.