Choice Group
Last updated
Was this helpful?
Last updated
Was this helpful?
A choice group offers values from a provided value list and returns the selected values as a carriage return-separated string to the dataprovider attached. When the value list offers display and return values, the return values are returned.
Note that if your value list does not have the "Allow empty value" check set, a user won't be able to remove the last selected value anymore.
The choice group component can be used in two modes: single select (either/or, aka radio button) or multi select. That mode can be controlled via the inputType property.
To see a live sample of the component you can go here.
In the Form Editor, drag the Choice Group component from the Pallet onto the form, then select a dataprovider and a valuelist.
dataprovider
is set as choice
Example:
In order to get a drop down menu with orders' ship countries, the followings settings should be made:
Like most components, Choice Groups have events, which allow you to execute some logic when something happens in the UI. Of course, the most common event for a Choice Group is the onDataChange
event, which is triggered when the component is clicked and the value is changed.
Choice Groups, like many components, can be modified at runtime through code. Below are a few examples of controlling a Choice Group from code.
You can easily change the enabled
state of a Choice Group at runtime.
Example:
You can easily change the visible
state of a Choice Group at runtime.
Example:
Like most components, a Choice Group has API methods which can be called from code. Below is an example of common API calls.
Example:
The following articles are recommended for additional reading
Choice Groups, like all components, have properties that can be modified at design time to set the appearance and behavior of the component. Select the component in the Form Editor to see a list of properties in the . Below are some common properties and how to set them at design time.
See the reference docs for Choice Group for a complete list of its .
Choice Group's dataprovider can be set after the component has been added to the form or by setting it in property, found in the .
Choice Group's input type can be set in property, found in the . It can be single select (either/or, aka radio button) or multi select.
IMPORTANT!
When the Choice Group property is set to checkbox
, then property must be a variable that can contain multiples values, such as form or scope variable.
Example:
Choice Group's can be set it in property, found in the and it should match the set .
set the Choice Group :
if is radio
, then can be either a table column (shipcountry
) or another type of dataprovider
if is checkbox
, then must be a variable that can contain multiples values, such as form or scope variable
in case it doesn't exist, create a using Table values and shipcountry
column as dataprovider
set the countries list in property of the Choice Group
To Handle the event, double-click the value for the property in the Properties Editor. You will see the Method Selection Wizard. You'll have the option to select an existing Method or create a new Method. The method will be called when the Choice Group's onDataChange
event is fired and the Event object will be passed to it.
See the Choice Group reference for a comprehensive list of
You can easily add a style class to a Choice Group using the method.
See the Choice Group reference for a complete list of programmable and .