<p:ajax> in <p:datatable> don't fire listener

UI Components for JSF
Post Reply
goiaba_sc
Posts: 3
Joined: 15 Mar 2011, 05:09

15 Mar 2011, 05:23

Hi, I'm having troubles when trying to use the <p:ajax> into a <p:datatable>. My problem is that the listener is never called. Anybody has already had this kind of problem?

I appreciate any help and I apologize for my bad English.

The code is below:

Code: Select all

<h:form id="formTurmasRegNota">

            <ui:repeat value="#{registrarNotaBean.escolas}" var="escola">

                <h:outputLabel value="#{escola.nome}" />

                <ui:repeat value="#{escola.cursos}" var="curso">

                    <h:outputLabel value="#{curso.descricao}" />

                    <p:dataTable value="#{curso.serieTurmas}" var="serieTurma" emptyMessage="#{i18n.nenhumRegistroEncontrado}">

                        <p:column>
                            <f:facet name="header">#{i18n.turma}</f:facet>
                            #{serieTurma.descricao}
                        </p:column>

                        <p:column>
                            <f:facet name="header">#{i18n.disciplina}</f:facet>
                                <h:selectOneMenu id="selectDisciplinas" value="#{serieTurma.disciplinaSelecionada}" required="true">
                                    <f:selectItem itemLabel="#{i18n.selecioneDisciplina}" noSelectionOption="true" />
                                    <f:selectItems value="#{serieTurma.disciplinasSelectItem}" />
                                    <p:ajax process="selectDisciplinas" update="selectAvaliacoes" event="change" listener="#{serieTurma.disciplinaChangedListener}" />
                                </h:selectOneMenu>
                        </p:column>

                        <p:column>
                            <f:facet name="header">#{i18n.avaliacao}</f:facet>
                            <h:selectOneMenu id="selectAvaliacoes" value="#{serieTurma.avaliacaoSelecionada}" required="true" disabled="#{!serieTurma.enableSelectAvaliacao}">
                                <f:selectItem itemLabel="#{i18n.selecioneAvaliacao}" noSelectionOption="true" />
                                <f:selectItems value="#{serieTurma.avaliacoesSelectItem}"/>
                            </h:selectOneMenu>
                        </p:column>

                    </p:dataTable>

                </ui:repeat>

            </ui:repeat>

        </h:form>

gcameo
Posts: 63
Joined: 02 Mar 2011, 07:38

15 Mar 2011, 07:04

First point of call is to use firebug to see if there are any requests to the server.

the check the response for validationFailed. In JSF request Lifecycle, if the validation fails, invoke application phase will not fire so your handler will never be called.

try those and lets know
Primefaces version: 3.0-SNAPSHOT

JSF implementation: Mojarra 2.0.4

Server: Glassfish 3.1-beta

goiaba_sc
Posts: 3
Joined: 15 Mar 2011, 05:09

15 Mar 2011, 22:40

Hi, gcameo, and thanks for your reply.

Here is the output from firebug when I change the selected item in the selectOneMenu that fires the listener:

<?xml version='1.0' encoding='UTF-8'?>
<partial-response><changes><update id="javax.faces.ViewState"><![CDATA[-5561622077512368652:-5048601272399157141]]></update></changes><extension primefacesCallbackParam="validationFailed">{"validationFailed":false}</extension></partial-response>

But I don't know how to interpret this.

Thanks for your help again.

goiaba_sc
Posts: 3
Joined: 15 Mar 2011, 05:09

16 Mar 2011, 02:42

Hi, I noticed that if I remove the outermost ui:repeat tag the listener is fired.

Any help?

Thanks.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 28 guests