Difference between revisions of "ValueRadio`1 (Component)"

From Neos Wiki
Jump to navigation Jump to search
(Creating the page (with a bot!))
 
(Wrote Article)
 
Line 10: Line 10:
 
<!--T:2-->
 
<!--T:2-->
 
== Intoduction ==
 
== Intoduction ==
 +
ValueRadio components can be used to create a radio selector, meaning a set of buttons that are used to set the same value to different options.
  
 
<!--T:3-->
 
<!--T:3-->
== Usage ==
+
== Fields ==
 
{{Table ComponentFields
 
{{Table ComponentFields
|CheckVisual|Bool|  
+
|CheckVisual|Bool| The boolean that is driven to true whenever the <code>TargetValue</code> is equal to the <code>OptionValue</code>
|OptionValue|T|  
+
|OptionValue|T| What to set the <code>TargetValue</code> to when the button is pressed.
|TargetValue|IField`1|TypeString2=IField<T>|  
+
|TargetValue|IField`1|TypeString2=IField<T>| The value to set when the button is pressed.
 
}}
 
}}
  
 
<!--T:4-->
 
<!--T:4-->
== Behavior ==
+
== Usage ==
 +
To function, the component simply needs to be attached to a slot that also has a button component attached to it. From then on, pressing that button will activate the ValueRadio, making it set its <code>TargetValue</code> to its <code>OptionValue</code>, which then also sets its <code>CheckVisual</code> to true.
  
 
<!--T:5-->
 
<!--T:5-->
Line 26: Line 28:
  
 
<!--T:6-->
 
<!--T:6-->
 +
== Related Issues ==
 +
[https://github.com/Neos-Metaverse/NeosPublic/issues/1855 <s>#1855 - Creating reference typed variants of several value type-only components causes crashes</s>]
 +
 +
<!--T:7-->
 
== Related Components ==
 
== Related Components ==
 
</translate>
 
</translate>

Latest revision as of 10:28, 27 December 2021


This article or section is a Stub. You can help the Neos Wiki by expanding it.


ValueRadio`1 component as seen in the Scene Inspector

Intoduction

ValueRadio components can be used to create a radio selector, meaning a set of buttons that are used to set the same value to different options.

Fields

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
CheckVisual Bool The boolean that is driven to true whenever the TargetValue is equal to the OptionValue
OptionValue T What to set the TargetValue to when the button is pressed.
TargetValue IField<T> The value to set when the button is pressed.

Usage

To function, the component simply needs to be attached to a slot that also has a button component attached to it. From then on, pressing that button will activate the ValueRadio, making it set its TargetValue to its OptionValue, which then also sets its CheckVisual to true.

Examples

Related Issues

#1855 - Creating reference typed variants of several value type-only components causes crashes

Related Components