- Print
- DarkLight
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);
}
}