I have the following Java Server Faces 2.0 composite component. Notice i am using verbatim
resources/customer/customer.xhtml
<composite:interface>
<composite:attribute name="id" required="false"/>
<composite:attribute name="firstName" required="false"/>
<composite:attribute name="lastName" required="false"/>
<composite:attribute name="age" required="false"/>
<composite:attribute name="rendered" required="false"/>
</composite:interface>
<composite:implementation>
<f:verbatim id="#{cc.attrs.id}" rendered="#{cc.attrs.rendered}">
<div>
<div>
<p>First name</p>
<h:outputText value="#{cc.attrs.firstName}"/>
</div>
<div>
<p>Last name</p>
<h:outputText value="#{cc.attrs.lastName}"/>
</div>
<div>
<p>Age</p>
<h:outputText value="#{cc.attrs.age}"/>
</div>
</div>
</f:verbatim>
</composite:implementation>
In order to use ajax, i have done (Notice render attribute)
<h:form id="search">
<div>
<h:commandButton value="Search" action="#{customerSearchController.search}">
<f:ajax execute="@form" render="search:result"/>
</h:commandButton>
</div>
<customer:customer id="result"
rendered="#{customerSearchController.customer != null}"
firstName="#{customerSearchController.customer.firstName}"
lastName="#{customerSearchController.customer.lastName}"
age="#{customerSearchController.customer.age}"/>
</h:form>
My CustomerSearchController is shown as follows
private Customer customer;
// getter's and setter's
public void search() {
customer = new Customer();
customer.setFirstName("First");
customer.setLastName("Last");
customer.setAge(30);
}
Both CustomerSearchController and Customer are managed beans. But when i call ajax request, it complains: search:result not found
What should do i to solve this issue ???