Salesforce

How Do I Implement a Radio Button? (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

How Do I Implement a Radio Button? (Magic xpa 4.x)

You can implement a radio button in two different ways. You can have the button contained in one control, in which case it will look like the traditional rectangular radio button. Or, you can have it contained in several controls, which gives you more flexibility in screen design. Let’s look at both options.

Containing a radio button in one control

You can create a radio button that is totally contained in one control. This sort of radio button will be a rectangular box. To create this kind of radio button:

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

  2. Drag the Radio Button from the Toolbox and drop it on your form.

  3. Select your virtual for the Data property.

  4. Enter your Items list according to what data you want sent back to the virtual.

  5. Enter your Display list according to what you want displayed in the Radio Button.

  6. You can also set other properties to determine the number of columns, the font, and other display properties.

Now, the user will be able to choose from the valid values in the radio box at runtime.

Using several controls for a radio button

Alternatively, you can display the radio button using several controls. This gives you the ability to spread the display over several parts of the form. To do this:

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

  2. Drag the Radio Button from the Toolbox, and drop it on your form.

  3. Select your virtual for the Data property.

  4. Enter only one item for your Items list according to what data you want sent back to the virtual. In this example, the virtual will contain ‘3’ if the color Green is chosen.

  5. Enter only one item for your Display list according to what you want displayed in the Radio Button. This part of the radio button will display ‘Green’.

  6. You can also set other properties to determine the number of columns, the font, and other display properties.

Choosing the same variable for each of the radio buttons “hooks” them together, so they act as a unit. That is, if you click on one of the buttons at runtime, the previous choice is blanked out. Also, when you are working with the buttons, they move as a unit. However, they are still separate controls and you can edit and move them separately.

See also

The Online and Rich Client Samples projects (program HG18 and RHG18)

Reference
Attachment 
Attachment