We have answer of your question!

100% solved queries, no empty question

Question: Ajax update don't update my components


0

I'm working now with the <p:ajax> to update/fill out my components, but when I select the Object in the autoComplete , the ajax don't update my components.

My code in below:

   <p:panel header="Actviter le Projet">
<!--############# Chercher le Projet #############-->
    <div id="projetCompleteCenter" align="center">
    <h:outputLabel value="#{bundle.searchProject}  " />
    <p:autoComplete id="autoCompleteProjet" forceSelection="true"
    minQueryLength="3" value="#{projetMB.projet}"
        completeMethod="#{projetMB.completeProjet}" var="projet"
       itemLabel="#{projetMB.projet.nomProjet}" dropdown="true" >
     <p:ajax update="nomProjet nombreHeure dateDemarrage typeProjet" />
</p:autoComplete>
</div>

<p:separator />

<!--############# Donées du Projet #############-->
<div id="idPanel">
       <h:panelGrid columns="2">

    <p:outputLabel for="nomProjet" value="#{bundle.nomProjet} " />
                        <p:inputText id="nomProjet" value="#{projetMB.projet.nomProjet}"
                            required="true">
                            <f:validateLength minimum="3" />
                        </p:inputText>

                        <p:outputLabel for="nombreHeure"
                            value="#{bundle.nombreHeuresProjet} " />
                        <p:inputText id="nombreHeure"
                            value="#{projetMB.projet.nbHeuresProjet}" required="true">
                            <pe:keyFilter mask="num" for="nombreHeure" />
                        </p:inputText>

                        <h:outputLabel for="dateDemarrage"
                            value="#{bundle.dateDemarrageProjet} " />
                        <p:calendar id="dateDemarrage"
                            value="#{projetMB.projet.dateDebutProjet}" required="true"
                            pattern="dd/MM/yyyy" showOn="button" navigator="true"/>

                        <h:outputLabel for="typeProjet" value="Type du projet: " />
                        <h:selectOneListbox id="typeProjet"
                            value="#{projetMB.projet.type}">
                            <f:selectItems value="#{projetMB.typeProjetList}" var="pr"
                                itemLabel="#{pr.typeLabel}" itemValue="#{pr.typeValue}" />
                        </h:selectOneListbox>

                    </h:panelGrid>
                </div>

What is wrong ?

Thank you!

Question author Andriel | Source

Answer


1


As the default event for UIInputs is the valueChange event, I think that your problem is, that you have not specified the event attribute of p:ajax. In the showcase they specifiy it explicitly either, so I think that the default event of p:autoComplete is actually the the "itemSelect"-event. So you would have to specify the "itemSelect"-event explicitly:

<p:ajax event="itemSelect" update="nomProjet nombreHeure dateDemarrage typeProjet" />
Answer author User1983983

Tickanswer.com is providing the only single recommended solution of the question Ajax update don't update my components under the categories i.e java , jsf , primefaces , . Our team of experts filter the best solution for you.

Related Search Queries:


You may also add your answer

Thanks for contributing an answer to Tick Answer!