This has been driving me crazy for two weeks. It's probably something really stupid or obvious, but for the life of me I can't get the page to render a collection of child objects.
Here's the basic outline, stripped down to what I hope are the essentials:
1. In the backing bean, I have an ArrayList<> property with a getter:
Note that the data returned may be obtained in a couple of different ways. Either way, however, it's an ArrayList.
2. The SurveyTopic class looks like this (again, excess stuff removed for clarity):
Note that it contains a member ArrayList of another object type.
3. I want to display the SurveyTopic objects in a dataTable, with each object's list of SurveyReponse objects listed in a single column of the dataTable:
Now, to the crux of the matter:
When the page displays, the dataTable renders fine, but the column that's supposed to show the surveyResponses objects is empty (the header facet displays, though).
Some more notes:
1. Yes, there is data in the embedded ArrayList. I can see it in the debugger.
2. I originally had the surveyResponse objects displaying in an embedded dataTable, beneath each row of the main dataTable. The same thing happened, though: the main dataTable displayed fine, but there were no surveyResponse objects at all on the rendered page. It's as if that code wasn't even there.
3. A breakpoint in SurveyTopic.getSurveyResponses is not hit. It looks like
JSF does not translate
into a call to the getter. I confess to some uncertainty over exactly how JSF does this, and over what the allowable syntaxes are.
4. The same thing happens if I change
to
above.
5. All the data is coming from a MySQL database, via Hibernate.
Any ideas or suggestions are most welcome.
Thanks in advance, and thanks also for creating and running this forum. You can hardly search for
Java programming-related information on the web without getting referred here.