I'm creating a page where a user selects elements to be added to a entity object from a rich datatable...simple enough.
That functionality works-when I look at the domain object through the debug.seam view, I see it's being updated.
But when I attempt to display/iterate over the list of elements in the domain object, I'm getting this error:
javax.el.ELException: /home.xhtml: Property 'name' not found on type java.util.HashSet
<h:inputText id="findMentor" value="#{newTeamFormMap.mentorName}"> <a4j:support event="onkeyup" reRender="mentorSelectList" requestDelay="1000" ignoreDupResponces="true" eventsQueue="myQueue" /> </h:inputText> <rich:spacer height="10"/> <rich:dataTable id="mentorSelectList" value="#{userHome.findByNameOrInternetID( newTeamFormMap.mentorName )}" var="user" render="#{not empty newTeamFormMap.mentorName}"> <rich:column> <f:facet name="header">Name</f:facet> #{user.name} </rich:column> <rich:column> <f:facet name="header">Add to List of Project Mentors</f:facet> <a4j:commandButton type="submit" value="Add" reRender="selectedMentorList" action="#{newTeam.mentors.add(user)}" /> </rich:column> </rich:dataTable> <rich:spacer height="10"/> <a4j:repeat id="selectedMentorList" value="#{newTeam.mentors}" var="selectedMentor" rendered="#{newTeam.mentors.size gt 0}" summary="Project Mentors"> #{selectedMentor.name} </a4j:repeat>
#{selectedMentor.name}
You can't use a set for a datatable. Workaround: Use @DataModel (you can with this), use an entityquery.datamodel, or use a facelets function to convert.