Not able to add attribute for radio buttons

Hi Team,   Please help me on this,   Scenario :  I have created a page for online test, Where I have question list and option list loaded from the database. I have created the Listview to show the question and trying to add radio buttons to show the options. But I am not able to add attribute list for the options. Please help me on this.      
2 answers

Hello Jenifer

Unfortunately the default Mendix widget requires your selection to be made from an enumeration.

You can either:

  1. Convert your selection to be an attribute on your object of type enum
  2. Use associations and a widget – this Radiobutton list widget should do the trick

Hope this helps


Hi Jenifer

Mendix radio button widget allow only to use boolean values or enumerations. If you want create test where only possible answer will be Yes/No or number of available answers will never change radio button is good option. But from my experience I suggest to use two entities with two associations. First association * -* defines available answers for selected question, second * - 1 is used to select correct/chosen answer for this question. When you add some dummy data, use input reference set selector to assign Options To Question (with you can eaisly manipulate what option is display for question). And now you can add association RadioButton to your listview. Configure widget like in screen. and restrict options with xpath. And after that you can have working question dictionary with predefinied answer. If you want to have online test, you still need to add next entities that will store question answer per user/test, but this is good starting point.