Web Components for Insights Hub and Industrial IoT
context attribute may be used to control the behavior of fetching and displaying data when the component is used multiple times.
By default, components of same type share the same
context. I.e., they fetch the data once and reuse it. Filter or search applied to one component instance affects all component instances within the same
When using multiple Asset View components simultaneously, they have the same
context, if not assigned otherwise. If the user filters for specific assets in one Asset View component, the other components would apply the same filter. This is avoided by applying a different
context value for each component. In this case the data is fetched separately for each
If an Asset View component is used inside a dialog box, the
context enables the component to reuse the fetched data although the component is destroyed every time the dialog box is closed.
<html> <head> <title>Context Example</title> </head> <body> <!-- Dialog Box Element--> <div class="dialog-box"> <!-- .... --> <mdsp-asset-view context="dialog-context"></mdsp-asset-view> <!-- .... --> </div> <!-- Main Page Element --> <div class="main-container"> <!-- .... --> <div class="asset-navigation"> <mdsp-asset-view context="asset-navigation"></mdsp-asset-view> </div> <!-- .... --> </div> </html> </body>
Except where otherwise noted, content on this site is licensed under the Development License Agreement.