Salesforce

How Do I Dynamically Set the Option List of a Choice Control? (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

How Do I Dynamically Set the Option List of a Choice Control? (Magic xpa 3.x)

While you can hard-code the choices for an option list, you can also set them dynamically, using expressions. In this example, we dynamically created the radio button from four user entries.

Creating a dynamic choice control

To create a dynamic choice control:

  1. Create a virtual that will hold the choice. In this example, it is variable P.

  2. Drag the Radio Button from the Toolbox (or whatever choice control you are using), and drop it on your form.

  3. Select your virtual for the Data property. In this example, it is variable P.

  4. Create an expression for your Items List property, that will evaluate into the comma-delimited string you need at runtime.

  5. Create an expression for your Display List property, that will evaluate into the comma-delimited string you need at runtime. In our example, we made it the same as the Items list.

    Optionally, you can also enter some data string in the Display list. This value will show up in the Studio, and might make it easier to understand the form for the programmer. In our example we used “x,y,z”.

Now, the choice control values will be determined at runtime, according to the values in the expression.

See also

The Online and Rich Client Samples projects (program HG20 and RHG20)

Reference
Attachment 
Attachment