Linking Components

Hi, I am not exactly sure on how to do this or even if you can. How would i go about linking a component on one root container of a window to a component on a different root container of a window. By linking i mean using it in the script or even binding a property to the component on one root container to another component on another root container. For instance, i have a label on a docked window which needs to change its text every time a button on a second docked window is used. Or is there a way to have two docked windows on one root container?

Thank You.

You must use scripting, as the standard bindings only work within one window. Windows are peers and the platform cannot guarantee that one window is open for another to bind to.
The simplest approach is to use a propertyChange event on one window to look up the 2nd window and write the new value to the appropriate place. With error handling as needed for failure to get the 2nd window. In the second window, use a window event to load the value from the first window when activated.

Thank you for the fast reply. My next question is then how do i use the property change event handler to look up the second window? Do i have to write the path in the script of the other window as well? or am i able to use the insert a property option and look for the path to the component on the second window?

The propertyChange event script would look something like this:if event.propertyName=='sourceProperty': w = system.gui.getWindow('otherWindowName') if w: c = w.rootContainer.getComponent('otherComponentName') c.otherProperty = event.newValueThe script editor will only offer things in the current window, so you have to type the strings in yourself.