'JSF pass list of object to composite component?
When I write like this in xhtml file it works fine;
<c:forEach items="#{employeeBean.findAll()}" var="item">
#{item.id} - #{item.name} <br/>
</c:forEach>
But when I pass a list of objects to a composite component like this;
<ez:ip-input_search
id='employeeSearchInput'
type='text'
placeholder='select a employee'
required='true'
options="#{employeeBean.findAll()}"
value="#{jobFormBean.employee}"
/>
then when I iterate this list;
<ui:repeat value="#{cc.attrs.options}" var="option">
<div class="ip-dropdown_option" onclick="setOption(this)" id="#{cc.id}_dropdownOption_#{cc.attrs.options.indexOf(option)}">
<h:outputText value="#{option.name}"/>
</div>
</ui:repeat>
I can't access to object of property and I get an error like this
value="#{option.name}": The class 'java.lang.String' does not have the property 'name'.
How can I access the object of property in the composite component?
thanks.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
