The HideContent API lets you programmatically close one or more matching content items within a running ViewApp. Multiple content items can be closed if they match the parameters that are specified in the HideContent call. The HideContent() function uses a subset of the parameters that the ShowContent API uses.
HideContent works only within a single level of the layout, and the level is defined by the SearchScope parameter. By default, SearchScope is "Self," and searches within the layout that has invoked it. This function is available within any Industrial Graphics client script or AVEVA OMI layout script. SearchScope parameters other than "Self" constrain the search for content to only layouts that are directly associated with screens, and not a nested layout. (A nested layout is a layout embedded or contained in a pane of another layout.)
Note: While the HideContent() function is available in object scripts through both IntelliSense and the IDE function browser, its use in object scripts is not supported.
ContentInfo
ContentInfo is the description of the content, along with the location of the content (screen and pane) to be hidden. ContentInfo properties for HideContent are a subset of the properties used for ShowContent.
When no ContentInfo properties are specified with HideContent, the nested layout or graphic that called it is hidden. In this case, it works identically to the HideSelf method. See the Application Server Scripting Guide for information about the HideSelf() function.
If HideContent with no properties is called from the top level of a layout, it has no effect; that is, the top level layout is not closed.
Content
A unique name for an item, either in the Graphic Toolbox or associated with an asset, that specifies the content to be loaded into the pane. Content can be a symbol, a layout, or external content.
Content name cannot contain more than 32 characters. The name must contain at least one letter. Valid characters are alphanumeric and special characters dollar sign, pound sign, and underscore ($, #, _).
Content is an optional property for HideContent (it is required for ShowContent).
"Content" is the name of the item within the Graphic Toolbox or associated with an asset.
The content names are the names shown in the Graphic Toolbox. The Properties tab of the Layout and ViewApp editors lists content name as the Content property. Relative names, for example, "Me.S1," can also be used to designate content.
Content name must be unique. Application Server does not check for duplicated names. The same content may be associated to multiple panes. In this case, calling HideContent with only the Content parameter will close all instances of that content.
If Content is duplicated, all content with the same name is closed.
If the same content item is used in multiple panes of the layout, and if the "Content" property is specified by the HideContent() method with SearchScope set to AllScreens, all instances of the content item are hidden. To hide a single instance of a content item that appears more than once in the layout, use the "Name" property instead.
Name
Name is the auto-generated (or user-edited) name of a unique content item. The name is created when the content item is added to a layout pane.
"Name" must be unique within a layout. Name can be duplicated in nested layouts, as long as the name is not duplicated within a nested single layout or the top level layout.
The content Name property is shown in the Properties tab of the Layout Editor, and is auto-generated from the Content property, also shown in the Properties tab. You can edit the Name property.
When Name is specified in a HideContent call, only the uniquely-named content is closed. If "Content" is specified and the "Name" property is not specified, all items in the layout with the same content name are hidden. If both are specified, "Name" has precedence.
ScreenName
Specifies the screen that contains a pane in which to place the content.
ScreenNames are configured in the Screen Profile Editor. See Screen Profiles in the AVEVA OMI Help for additional information.
PaneName
Name of the pane in which to load the content.
PaneNames are configured in the Layout Editor. See Layouts in the AVEVA OMI Help for additional information.
ContentType
Specifies the content type, for example, "Overview," "Navigation," or "Faceplate" to be loaded.
ContentType is matched against the Content Type parameter that can be set for a pane in the Layout Editor. ContentType is used to override the actual type of the specified Content. If ContentType is not specified, Content is examined for its type of content. See Layouts in the AVEVA OMI Help for additional information about content types.
SearchScope
When ScreenName has not been specified, SearchScope specifies which screen or screens will be searched for a pane that matches the specified PaneName or content type. The default SearchScope is "Self."
ScearchScope is an enum with the following values
- Self searches for matching content within the panes of the layout from which the HideContent call was made. If SearchScope is not specified, "Self" is the default. When SearchScope = Self, the layout that initiated the call is searched, whether it is the top level layout or a nested (embedded) layout. Unlike "Self," the remaining SearchScope values reference only the top level layout, not nested layouts.
- AllScreens searches for matching content within the panes of all screens in the top level layout. The search starts with the source screen, then the primary screen, and then any remaining screens in alphabetical order.
- SourceScreen searches for matching content only within the panes of the top level layout from which HideContent was called.
- PrimaryScreen searches for matching content only within the panes of the top level layout of the screen designated in the Screen Profile as the primary screen.
If SearchScope is Self or is not specified, HideContent searches for a matching pane within the embedded layout that initiated the HideContent call.
When SearchScope is All, Source, or Primary, or if the ScreenName is specified, HideContent searches for matching content within the top-level layout only.
See SearchScope Enum for detailed information.
PropertyOverrides
Not applicable for use with HideContent. This is used for ShowContent calls only. See ShowContent API for more information about the PropertyOverride paramter.
OwningObject
OwningObject can be used for relative referencing. It can be a concatenation of constant strings and reference strings. It can be browsed using the Display Automation Object Browser, or you can type the name of the owning object.
Note: The OwningObject property sets references for the graphic, but is not associated with the GraphicName property if the symbol is part of an Object Wizard. Therefore, if you are scripting a symbol with an owning object, specify the owning object name as part of the GraphicName property, for example, UserDefined_001.Pump_001. Can be a concatenation of constant strings and reference strings.