I have a Facelets subview called basedata-cpanel.xhtml
, which gets its parameters passed via <ui:param>
s:
<ui:define name="content-top">
<h:form>
<ui:include src="/subviews/basedata-cpanel.xhtml">
<ui:param name="customerId" value="#{pqHome.pq.customer.id}" />
<ui:param name="customerName" value="#{pqHome.pq.customer.name}" />
<ui:param name="customers" value="#{organizationManager.allCustomers}" />
<ui:include />
</h:form>
</ui:define>
In the subview, I simply want a panel below to show the currently selected customer name (the panel is for NEW and UPDATE panels/pages). I need an AJAX request for this.
Code in /subviews/basedata-cpanel.xhtml
:
<h:selectOneMenu value="#{customerId}" id="customer-select">
<f:selectItems value="#{customers}"
var="customer"
itemValue="#{customer.id}"
itemLabel="#{customer.name}" />
<f:ajax render="customer-name" />
</h:selectOneMenu>
<h:outputText value="#{customerName}" id="customer-name" />
I put the <f:ajax render="customer-name" />
into the select, but the outputText isn't updated. I didn't really expect it to, but...
What do I need to do to get it to work?
As the Facelets subview still has the same parameters as they were passed, how do I get "new ones" in? What's the best practice for this?
PS: pqHome is a @ViewScoped
bean