Show TOC

Background documentationProperty Access Locate this document in the navigation structure

 

SAP Manufacturing Integration and Intelligence (SAP MII) uses design patterns to access properties. For most parameters, you can prefix the parameter name with get to retrieve a specific applet attribute or set to assign a parameter value. For example, to read the refresh interval using the applet parameter name RefreshRate, use the following syntax:

currentRefreshRate = document.<appletName>.getRefreshRate();

To write the refresh interval, use the following syntax

document.<appletName>.setRefreshRate(60);

Boolean Properties

Boolean data types are an exception. To return a Boolean, use an is method followed by the attribute name. To read a Boolean applet property like AutoRefresh, use the following syntax:

currentAutoRefresh = document.<appletName>.isAutoRefresh();

To write the value, use the following syntax:

document.<appletName>.setAutoRefresh(true);

Indexed Properties

Another exception is indexed properties. To set a tag name in a query object or min/max scaling ranges in a chart, the get/set or is/set methods require an additional parameter that corresponds to the index of the item to be read or written. The first SAP MII indexed property has a value of one. For example, to set the first three tags, you could use the following script:

document.<appletName>.getQueryObject().setTagName(1,"ReactorLevel");

document.<appletName>.getQueryObject().setTagName(2,"ReactorTemperature");

document.<appletName>.getQueryObject().setTagName(3,"ReactorPressure");

To synchronize scaling between three tags, you could use script similar to the following:

var minRange,maxRange;

minRange = document.<appletName>.getChartObject().getMinRange(1);

maxRange = document.<appletName>.getChartObject().getMaxRange(2);