STRING_LINK
This element connects a string to another one: whenever the 'from' string changes, the 'to' string takes the 'from' string value.
Attributes brief detailed show all inherited
| Name | Description | Default | |||
|---|---|---|---|---|---|
| from | Identifier of the origin string | empty | |||
| to | Identifier of the target string | empty | |||
| enabled | Enables or disables the link | 'true' | |||
| Common attributes | |||||
| id | Identifier of the element | empty | |||
Examples
Link string_a to string_b, so that every time string_a changes, string_b follows.
- <!-- string -->
- <STRING id="string_a" default="Hello!" />
- <STRING id="string_b" default="World!" />
- <!-- link -->
- <STRING_LINK from="string_a" to="string_b" />
- <!-- controls -->
- <TEXT_FIELD string_id="string_a" />
- <TEXT_FIELD string_id="string_b" />
We can enable and disable links on the fly, like this:
- <!-- string -->
- <STRING id="string_a" default="Hello!" />
- <STRING id="string_b" default="World!" />
- <STRING id="result" default="" />
- <!-- link -->
- <STRING_LINK id="link_a" from="string_a" to="result" enabled="false" />
- <STRING_LINK id="link_b" from="string_b" to="result" enabled="false" />
- <!-- which link to enable -->
- <PARAM id="which_link" type="enumeration" enum_values="Off;Link A;Link B" />
- <PARAM_LINK from="which_link" to="link_a.enabled" formula="x==1" />
- <PARAM_LINK from="which_link" to="link_b.enabled" formula="x==2" />
- <!-- controls -->
- <TEXT_FIELD string_id="result" />
- <PARAM_TEXT_CONTROL param_id="which_link" content="link: {text_value}" />

We can also link to/from some string attributes of various elements (like KUIML_WIDGET.innerKUIML or PARAM.text_value)
- <STRING_LINK from="demo_param.text_value" to="my_string" />
- <PARAM id="demo_param" default="1.125345" max="100" />
- <STRING id="my_string" default="Hello!" />
- <!-- display and edit a string -->
- <PARAM_TEXT_CONTROL param_id="demo_param" content="param: {value}" />
- <ROW>
- <TEXT value="string" /><TEXT_FIELD string_id="my_string" />
- </ROW>

See more examples in "Changing text on the fly" tutorial.
Comments
Please, authorize to view and post comments.
