Automated: create new component page |
unstub |
||
Line 1: | Line 1: | ||
{{Infobox Component | {{Infobox Component | ||
|Image=ParentReferenceLink`1Component.png | |Image=ParentReferenceLink`1Component.png | ||
|Name= | |Name=ParentReferenceLink<Slot> | ||
}} | }} | ||
== | The '''ParentReferenceLink<T>''' component [[drives]] a [[field]] depending on the value of a compatible [[Component:ParentReference|ParentReference]] as part of a [[parent value]] system. | ||
== Fields == | |||
{{Table ComponentFields | {{Table ComponentFields | ||
|MatchTag|String| | |MatchTag|String|The tag to search for on the slot's immediate parent. Compatible [[Component:ParentReference|ParentReference]] components must have the same <code>Tag</code>. | ||
|Target|{{RootFieldType|RefDrive`1|T}}|TypeAdv1=true| | |Target|{{RootFieldType|RefDrive`1|T}}|TypeAdv1=true|The field to drive using the value of the linked parent. | ||
|WriteBack|Bool| | |WriteBack|Bool|If <code>True</code>, any writes to the driven field will be propagated back to the <code>Reference</code> provided by the ParentReference. | ||
|DefaultReference|'''T'''|TypeAdv3=true| | |DefaultReference|'''T'''|TypeAdv3=true|Default value to use if the component can not find a compatible ParentReference. | ||
}} | }} | ||
== | == Usage == | ||
Upon a change of parent, this component will search for ParentReference components on the slot's immediate parent that have a matching type and tag. If it can find such a component and link to it, it will drive the <code>Target</code> field based on the <code>Reference</code> of the ParentReference. If it can not find such a component, it will use the <code>DefaultReference</code> value. | |||
== Examples == | == Examples == | ||
Line 19: | Line 22: | ||
== See Also == | == See Also == | ||
[[Category:Components:Data:Parent{{#translation:}} | * [[Component:ParentValueLink]], for [[value types]] | ||
[[Category:Components{{#translation:}} | |||
[[Category:Generic Components{{#translation:}} | [[Category:Components:Data:Parent{{#translation:}}]] | ||
[[Category:Components{{#translation:}}]] | |||
[[Category:Generic Components{{#translation:}}]] |
Latest revision as of 20:03, 18 December 2024
Component image
The ParentReferenceLink<T> component drives a field depending on the value of a compatible ParentReference as part of a parent value system.
Fields
Name | Type | Description |
---|---|---|
persistent
|
Bool | Determines whether or not this item will be saved to the server. |
UpdateOrder
|
Int | Controls the order in which this component is updated. |
Enabled
|
Bool | Controls whether or not this component is enabled. |
MatchTag
|
String | The tag to search for on the slot's immediate parent. Compatible ParentReference components must have the same Tag .
|
Target
|
direct RefDrive`1<T> | The field to drive using the value of the linked parent. |
WriteBack
|
Bool | If True , any writes to the driven field will be propagated back to the Reference provided by the ParentReference.
|
DefaultReference
|
T | Default value to use if the component can not find a compatible ParentReference. |
Usage
Upon a change of parent, this component will search for ParentReference components on the slot's immediate parent that have a matching type and tag. If it can find such a component and link to it, it will drive the Target
field based on the Reference
of the ParentReference. If it can not find such a component, it will use the DefaultReference
value.