Hi,
I'm trying to dynamically add radio buttons to a page.
The database is like this:
ParentControl (PC)
->RadioButtonControl (RBC)
So one instance of PC could have 1 or more instances of RBC, but the RBCs have to be grouped by their PC so that they're mutually exclusive and can work like radio buttons normally do. I'm pulling the records so that I pull every RBC joined with a PC, so two PC with 5 RBC means 10 records.
I'm putting the records into a Table Records control, and using IFs to show the radio buttons. Since each radio button is its own record, there's no way for them to share variables so that the RBCs can be mutually exclusive.
I thought I could have an array of values, structured something like
Values[Get the index in the array of the given PC] = RBC.ID
So that since the RBCs know their own PCs, they'll be able to see whether or not they're the currently selected ID.
This doesn't work. It looks like making the Variable property = Values[index] makes OutSystems treat the shared variable as Values rather than Values[index]. This means that regardless of PC, every RBC is mutually exclusive to each other.
Is this even possible to do?
Edit:
One more wrench to throw into the mix, this all has to be done without using the Checkbox control's On Change event.
I'm trying to dynamically add radio buttons to a page.
The database is like this:
ParentControl (PC)
->RadioButtonControl (RBC)
So one instance of PC could have 1 or more instances of RBC, but the RBCs have to be grouped by their PC so that they're mutually exclusive and can work like radio buttons normally do. I'm pulling the records so that I pull every RBC joined with a PC, so two PC with 5 RBC means 10 records.
I'm putting the records into a Table Records control, and using IFs to show the radio buttons. Since each radio button is its own record, there's no way for them to share variables so that the RBCs can be mutually exclusive.
I thought I could have an array of values, structured something like
Values[Get the index in the array of the given PC] = RBC.ID
So that since the RBCs know their own PCs, they'll be able to see whether or not they're the currently selected ID.
This doesn't work. It looks like making the Variable property = Values[index] makes OutSystems treat the shared variable as Values rather than Values[index]. This means that regardless of PC, every RBC is mutually exclusive to each other.
Is this even possible to do?
Edit:
One more wrench to throw into the mix, this all has to be done without using the Checkbox control's On Change event.