This problem seemed to me to be a lot easier than it winded up being. I hope someone can help shed some light on it. Here it goes... I need to dynamically display a list of radio buttons(it gets the data from a database). Here is the catch. Underneath each radio button, there needs to be an additional line of text describing the radio button. I don't need help with accessing the database, getting the data from my backing bean, or even displaying the radio buttons to the screen. I have that covered. What I need help with is displaying the line of descriptive text that goes below each radio button. Here is what I have tried in my
jsp:
<af:selectOneRadio >
<af:forEach var="sg" items="#{sgMainBean.sgList}">
<af:selectItem label="#{sg.sname}" />
</af:forEach>
</af:selectOneRadio>
The problem with going that route is that I have no place to put the line that prints out the description:
<af:outputLabel value="#{sg.description}"/>
If I put it inside the forEach tag, then it is inside the selectOneRadio and will not be displayed correctly. Also, if I put it outside the selectOneRadio tag, then it is outside the forEach tag and is not iterated with the rest of the bunch.
Another route I have tried is the following:
<af:selectOneRadio>
<f:selectItems value="#{sgMainBean.showSelectItems"/>
</af:selectOneRadio>
Again, since it just goes through all the items, I am unclear on where I can put the code to access the description where it can be reached. Any help would be great. Thanks.