Radio Button

0
How to use Radio buttons in Mendix development
asked
3 answers
3

If you already have an existing entity and a page and want to put a radio button inside the page for the user to fill in, simply add a Data View from the Toolbox to your page. Then, under Data Source, pick Context and choose your Entity name. You will then be prompted to automatically generate all elements from the entity. Click Yes. A form will be automatically generated to your page. You can change the input type of the Gender by dragging “radio buttons” from the Toolbox then attaching the attribute name of your entity into that input widget. Note that you can only use radio buttons for elements that are of type BOOLEAN or ENUMERATION. 

Since the data type Boolean is for True and False, I would suggest you use ENUMERATION instead. You can create a new ENUMERATION and adding Male and Female into the enum list. Then, use that as the type of your Gender attribute in the Domain Model.

answered
1

Check out the learning paths. If you have an enumeration or boolean attribute, you can use radio buttons to select the value.

answered
1

I second the recommendation from Andreas that you follow a learning path on learn.mendix.com. You’ll see that this question and many others are answered along the way.

The basic steps are:

  1. Create domain model entity with a boolean or enumeration attribute
  2. Create a page with a data widget (data view, list view) connected to your entity
  3. Drop a radio buttons widget onto the page inside that data widget
  4. Open the properties of the widget and select the attribute you’d like the radio buttons to operate.
answered