The tag:
Code: Select all
<p:ajax update="cidade" listener="#{cc.attrs.actionTrocaEstado}" />
Just work with:
Code: Select all
<p:ajax update="@all" listener="#{cc.attrs.actionTrocaEstado}" />
Code: Select all
public void actionTrocaEstado(){
System.out.println("hi");
}
My primefaces:
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>2.2.1</version>
</dependency>
GlassFish v3 and JBoss AS 7 have the same problem with this tag "p:ajax".
My code is:
Code: Select all
<cc:interface>
<cc:attribute name="listaEstado" required="true" />
<cc:attribute name="estadoSelecionado" required="true" />
<cc:attribute name="listaCidade" required="true" />
<cc:attribute name="cidadeSelecionada" required="true" />
<cc:attribute name="actionTrocaEstado" method-signature="void action()" />
<cc:attribute name="actionTrocaCidade" method-signature="void action()" />
</cc:interface>
<cc:implementation>
<h:outputLabel value="#{msg['label_estado']}" for="estado" />
<h:selectOneMenu id="estado" value="#{cc.attrs.estadoSelecionado}">
<f:selectItem itemLabel="#{msg['label_combo_selecionar']}" />
<f:selectItems value="#{cc.attrs.listaEstado}" var="estado"
itemValue="#{estado.id}" itemLabel="#{estado.nome}" />
<p:ajax update="cidade" listener="#{cc.attrs.actionTrocaEstado}" />
</h:selectOneMenu>
<h:outputLabel value="#{msg['label_cidade']}" for="cidade" />
<h:selectOneMenu id="cidade" value="#{cc.attrs.cidadeSelecionada}">
<f:selectItem itemLabel="#{msg['label_combo_selecionar']}" />
<f:selectItems value="#{cc.attrs.listaCidade}" var="cidade"
itemValue="#{cidade.id}" itemLabel="#{cidade.nome}" />
<p:ajax update="@all" listener="#{cc.attrs.actionTrocaCidade}" />
</h:selectOneMenu>
</cc:implementation>
Thanks all, and again, sorry my sux english.