Please enable JavaScript to view this site.

DAQFactory User's Guide

Navigation: 7 Pages and Components > 7.18 The Components > 7.18.2 Displays

7.18.2.11 Linked Component

Scroll Prev Top Next More

The linked component is a component that displays a copy of another component (or component group) elsewhere in your application, and will automatically update when the original component changes.  

Note: The original component or group should always be on a separate page from any linked component that references it.  This is because DAQFactory triggers a new copy of the original every time the original redraws.  If it is on the same page as the linked component, the linked component will recopy the original with every redraw.  This is inefficient, and more importantly will make many components not function correctly.  

We recommend creating a few pages just for original components that are copied by linked components, but never actually viewed except when they need to be edited.

This component can be used in at least three different ways:

At its simplest, a linked component can be used as a simple copy of a component that automatically gets updated with the original.  This might be useful when you need to display the same information, in the same way, in different places.  In this case, you just need to identify the original component or component group by full name (i.e. prefixed with component., or page.myPage.component.)

Like component groups, the copy of the original component or component group will exist in the scope of the linked component.  This means that multiple linked components of the same original component or group can display different things.

The first way to do this is by using the CreateProperty() and CreateStringProperty() functions to create unique settings that exist in the linked component but that can be seen by the copy of the original components.  These function calls should exist in the OnLinked event of the original component.  The OnLinked event exists in the original component, but is executed by, and in the scope of, the linked component that makes the copy of the original component, that way the new properties are created with every new linked copy.  See section 7.4.7 for detail on CreateProperty().

The second way is to use the expParentObject property of the linked component.  That property brings an object into the scope of the linked component, but since the original component exists in that same scope, it will also have direct access to the object.  You can then assign different objects to different linked components with the same original component.  See section 7.4.8 for details on expParentObject.

Properties:

Main:

SourceComponent: this is an expression that must result in another component.  As such, it will typically contain something like component.myComponent, or page.myPage.component.myComponent.  Whatever component you link to should have a unique name in the system, otherwise you won't know which component DAQFactory decided to linked to.  See chapter 4 for details about Expressions, and more importantly, section 7.4.6 on component names.

ScaleContentsToControl: if enabled, then the copied component is scaled to fit the linked component and the linked component can be resized, resulting in the copied component being resized as well.  If it is not enabled, then the linked component is sized the same as the original component and cannot be resized.

Common Properties:

This component includes all the common properties of components described in section 7.4.4 but not the background properties.