cancel
Showing results for 
Search instead for 
Did you mean: 

How to set default selection of radio button group in Visual Composer

Former Member
0 Kudos

Hi Everyone,

I create a code type that has two fixed values 1 and 2, and I set the default value as 1. Then I create a radio button group using this code type in Visual Composer. But the radio button group has no default selection. Does anybody have any idea about this issue?

Thanks,

Christo

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Christo,

Did you try to set a Default Value for the field that is bound to the Radio Group control?

If not you can do it in the Define Data dialog.

Best regards,

Udi

Former Member
0 Kudos

Hi Udi,

Thanks for your help. But I cannot find Default Value or Define Data dialog. I can only find Control Properties dialog in my VC model. Is it the Define Data dialog you mentioned? But I still cannot find Default Value in Control Properties dialog.

Best regards,

Christo

Former Member
0 Kudos

Hi Christo,

The Default Value can be set for the Field that the Radio Group is bound to.

I assume you put the Radio Group control on a Form View. If you right click the Form View abd select the Define Data option you can define the field I mentioned.

The following scenario is a Step-By-Step instruction of how to make a Radio Group with a default vaule selected.

Try it in a new model:

1. Drag a Form View to the Design board.

2. Right click that Form View and select the Define Data option.

3. Click the '+' (plus) button and select String - this should add a field named TXT1 of type string to the Form View.

4. Uncheck the most right column of the dialog (the column with the glasses header) and close the Define Data dialog

5. Switch to the Layout board.

6. Drag a Radio Group control to the Form View.

7. Right click the Radio Group and select the Configure option - the configure panel should appear on the right.

8. on the Value property, select the TXT1 as the field that will be bound to that control.

9. On the Entry List property, click the '...' icon.

10. The Entry List Wizard should appear and the Static option is selcted - Click Next

11. Define the entries of the Radio Group - for example - Value: "a", Display Text: "First Value" ; Value: "b", Display Text: "Second Value" ; and click finish.

12. Switch back to the Design borad

13. Right click the Form View and select the Define Data option.

14. Set the Default Value of TXT1 to b.

15. Deploy the model and note that the default selection of the Radio Group is "Second Value"

I hope this answers your question.

Best regards,

Udi