p:ajax doesn`t work, just work with update="@all"

UI Components for JSF
Post Reply
mbbittencourt
Posts: 1
Joined: 08 Aug 2011, 17:48

08 Aug 2011, 18:00

First at all, sorry my english.

The tag:

Code: Select all

<p:ajax update="cidade" listener="#{cc.attrs.actionTrocaEstado}" />
Doesn`t work, I have the id="cidade" on another component in my xhtml.

Just work with:

Code: Select all

<p:ajax update="@all" listener="#{cc.attrs.actionTrocaEstado}" />
My breakpoint at

Code: Select all

public void actionTrocaEstado(){
   System.out.println("hi");
}
Don`t stop if I don`t use @all or @form. My console just show "hi" with this tags: update="@all" or update="@form"

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>
I don`t pasted everythink on my code, but if anyone need, just ask.
Thanks all, and again, sorry my sux english.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 21 guests