Question:
I created an XPage with a repeat control on it.
The repeat control creates multiple radio buttons.
In order to connect the different radio buttons to a group they need to have the same group name.
The radio group name needs to be computed in my case.
The problem is that these computed radio group names are not equal per group.
This leads to the problem that the radio buttons don't build a group and it is possible to activate every radio button at the same time.
Is there any other workaround than manually create radio buttons?
Answer:
Use the "skipContainers" property to address this issue
.
If you select the Radio control, in the All Properties tab there's a property "skipContainers"
To fix the example you would set skipContainers to
1
If the radio buttons were nested within multiple repeats then you could choose what level to group to, e.g.:
<xp:repeat value="#{world.continentList}" var="continent">
<xp:repeat value="#{continent.countryList}" var="country">
<xp:radio text="#{country.name}" groupName="nameTypeInCountry"></xp:radio>
<xp:radio text="#{country.fullName}" groupName="nameTypeInCountry"></xp:radio>
<xp:radio text="#{country.name}" groupName="countryInCurrentContinent" skipContainers="1"></xp:radio>
<xp:radio text="#{country.name}" groupName="countryInWorld" value="#{countryInWorld}" skipContainers="2"></xp:radio>
</xp:repeat>
</xp:repeat>
The first two radios will be grouped within the inner repeat.
The 3rd radio will be grouped within the current continent.
The 4rd radio will be grouped across the entire HTML page.