The ShowContent API lets you programmatically load a symbol or a layout ("content") into a specific pane within a ViewApp, and set the focus on the pane. Internally, the ShowContent API leverages the ShowInPane method to load the content into the pane. Content is specified via the parameter "aaContent.ContentInfo."
ContentInfo
ContentInfo is the structure used by ShowContent to specify the symbol or layout that you want to load into a pane. It consists of one required and six optional data properties, listed below. String properties can be a concatenation of string and/or custom properties. The name of the content (Content) is the only information that must be specified. All other data properties are optional.
Content
A unique name that specifies the content to be loaded into the pane. Content can be a symbol, layout, or external content item. Symbol (graphic), layout, and external content names are listed in the Graphic Toolbox and in the Toolbox tab of the Layout and ViewApp editors.
Content name cannot contain more than 329 characters. The name must contain at least one letter. Valid characters are alphanumeric and special characters
($, #, _).
Content is a string and is the only required parameter. If no other properties are specified, the screen search order is as described under SearchScope Enum.
If the specified content is already showing, invoking ShowContent again closes the open content and reopens it. If the content has changed, the changes are shown.
If the content is a symbol and you are using object wizards that include Symbol Wizard custom property selections, and the symbol has an owning object, use the symbol's absolute name. This allows the correct symbol configuration to be shown for the instance. See the Owning Object, below, for more information.
Content name must be unique. Application Server does not check for duplicated names. If Content is duplicated, open content with the same name is closed, and the content with the duplicated name is opened in its place. PropertyOverrides and other ContentInfo parameters are updated with any new specified values.
If the same content item is used in multiple panes of the layout, and the "Content" property is specified by the HideContent() method, all instances of the content item are hidden. To specify a single instance, use the "Name" property instead.
Name
This 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.
If content with the same Name is open within the SearchScope, the matching, open content is closed. A new instance of the matching content opens in the pane specified by the ShowContent call.
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.
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 property 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.
SearchScope is an enum with the following values:
- Self searches for matching content within the panes of the layout from which the ShowContent call was made. The layout can be a nested layout or a containing (top-level) level layout. The If SearchScope is not specified, "Self" is the default. 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 ShowContent was called. Unlike Self, SourceScreen searches only the top-level layout, not nested layouts.
- PrimaryScreen searches for matching content only within the panes of the screen designated in the Screen Profile as the primary screen.
When SearchScope is self or is not specified, and ShowContent is called from a nested (embedded) layout, ShowContent searches locally for a matching pane within the embedded layout.
When SearchScope is All, Source, or Primary, or if the ScreenName is specifed, ShowContent searches for matching content within the top-level layout only. It uses the SearchScope setting to determine which screen(s) within the Screen Profile associated with the ViewApp will be searched.
See SearchScope Enum for detailed information.
PropertyOverrides
Specifies overrides for custom properties. This parameter is only valid if a symbol is the designated content. It is not valid if a layout has been designated. PropertyOverrides is a ValuePair structure. Each override must include both the name of the custom property to be overridden and the override value.
OwningObject
Specifies the owning object of the content to be shown by the ShowContent() method. Can be a concatenation of constant strings and reference strings.