Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Frank
0
Views
3
Comments
Variable number of questions
Question
Hello everybody,
This would be a great help for our project. If anyone can help us on this, it would go a long to make my outsystems project a big success. I wanted to use a table record widget and populate it with a variable number of questions(one question per row on the table). Next, I pulled three radio button widgets into one of the columns on the table. So on the webscreen, a user will see whatever number of rows with a question and 3 radio buttons in each row. The major issue is.....how do I record the user's selection of each of the radio buttons per question in the table when I press a "Save" button on the screen. I could create a radio button variable for each row, but I don't know how many rows I will have. I can limit the table rows to ten questions and have ten variables and save the ten variables in the database and reset the table to show the next set of ten questions. But the complications of tracking ten variables and inserting each of the variables into a table would make this task difficult. Is there an easier solution? Attached is the webscreen I am designing with the questions and radio buttons.
Thanks in advance.
Frank
P.S. I tried to attach a screen shot to this post, but the forum times out. So please contact me with an email address and I will email you directly with a screen shot.
Miguel Vaz
Hi Frank,
You could try to add a invisible field in each row and then add to the radiobuttons of the same row one onClick event via javascript to set the invisible field value with the selected option.
The code for each line should be inserted in one expression box with something like this for the radio buttons:
<input type="radio"
onclick
="document.getElementById('"+InvisibleInputField.id+"').val('1');" >
<input type="radio"
onclick
="document.getElementById('"+InvisibleInputField.id+"').val('2');" >
<input type="radio"
onclick
="document.getElementById('"+InvisibleInputField.id+"').val('3');" >
And then have one TextBox (binded to the record) per line with the name 'InvisibleInputField'
2 replies
Last reply 16 Dec 2011
Show thread
Hide thread
Frank
This might be the way to go. Does anyone else want to chime in with their opinions?
Frank
António Chinita
Hi Frank,
Why don't you create an attribute for that value
in the "question" record
? Let's call it
RadioButtonResult
for example.
This way, you will have N variables (as many as your table records rows) for your radio buttons.
When putting the radio buttons on the screen, assign it to the
TableRecords.list.Current.YourRecord.RadioButtonResultAttribute
.
On the Save action if you iterate through
TableRecords.List
the value will be correctly stored in the "
RadioButtonResultAttribute
" attribute.
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...