Is it possible to implement a dynamic webpage that shows different widgets based on certain variables?

0
Example, I have a webpage where by it is a questionnaire, but i want to be able to customize this questionnaire through an admin page. So my admin page should be able to choose whether i want a text box, radio buttons, text area, set my labels and everything.  I was wondering if something like this is possible in Mendix? To my knowledge, i cant choose what widget to display based on variables value. Mendix entities allow us to fill in the dataview automatically (i could use this automatic fill in feature), BUT how do i customize the Mendix entity during runtime? Thanks so much in advance!
asked
3 answers
2

Hi Raphael,

You could use inheritance for this, where you have a question entity and specialisations of that question entity (e.g. MultipleChoice, textInput etc.). Then you can use templates in a list view for those specialisations, where for multiple choice, you can show radio buttons, for text, you can show a text area etc. That way, based on what type of question your admin creates, it will be shown with to the user with the right type of input fields.

Also, you might be able to use the Questionnaire App Store module (https://marketplace.mendix.com/link/component/234).

Hope this helps.

Jody

answered
0

Hi Jody,

Thank you so much for giving me a direction! I will attempt it and update you again!

answered
0

hi Raphael Chia,

You could use “Condition for visibility” 

Go to the “property” of the Widget then Go to “Visibility” option then in the “show the text box” option you can put condition to visible that widget. I hope that this will help you     

answered