0

I have recently started to maintain an online system. It is using JSF with PrimeFaces for the front end, with a Java backend. JSF is a new technology for me.

When I execute the app, and click on the buttons, absolutely nothing happens. There are no errors in the execution. It simply doesn't do a thing.

Any ideas?

xHTML file:

 <p:form>
        <p:dialog header="Détail demande" widgetVar="demandeDialog"
            resizable="false" id="demDlg" showEffect="fade" hideEffect="explode"
            width="800px" closable="true" appendToBody="true" maximizable="true"
            minimizable="true">

            <h:commandButton value="Imprimer" type="button" icon="ui-icon-print"
                styleClass="alignmentRight">
                <p:printer target="displayDem" />
            </h:commandButton>

            <p:accordionPanel id="displayDem" multiple="true">
                <p:tab title="Informations générales">
                    <h:panelGrid id="displayInfoGen" columns="4" cellpadding="10">
                        <h:outputText value="N° demande" style="font-weight:bold" />

                        <h:outputText
                            value="#{demandeController.selectedDemande.idDemande}" />

                        <h:outputText value="N° de devis" style="font-weight:bold" />
                        <h:outputText
                            value="#{demandeController.selectedDemande.lastDevis.numDevis}" />

                        <h:outputText value="Date de saisie de la demande"
                            style="font-weight:bold" />
                        <h:outputText
                            value="#{demandeController.selectedDemande.dateSaisie}">
                            <f:convertDateTime pattern="dd/MM/yyyy" />
                        </h:outputText>

                        <h:outputText value="Date de réception de la demande"
                            style="font-weight:bold" />
                        <h:outputText
                            value="#{demandeController.selectedDemande.dateDemande}">
                            <f:convertDateTime pattern="dd/MM/yyyy" />
                        </h:outputText>

                        <h:outputText value="Observations" style="font-weight:bold" />
                        <h:outputText
                            value="#{demandeController.selectedDemande.observations}" />

                    </h:panelGrid>
                </p:tab>
                <p:tab title="Programmes">
                    <h:panelGrid columns="4" cellpadding="10">

                        <h:outputText value="Programme" style="font-weight:bold" />
                        <h:outputText
                            value="#{demandeController.selectedDemande.idProgramme.codeProgImmobilier} - #{demandeController.selectedDemande.idProgramme.nomCommercial}" />

                        <h:outputText value="N° de lot" style="font-weight:bold" />
                        <h:outputText
                            value="#{demandeController.selectedDemande.idBien.idBien}" />

                        <h:outputText value="Nom de l'acquéreur" style="font-weight:bold" />
                        <h:outputText
                            value="#{demandeController.selectedDemande.idAcquereur.genreEtatCivil} #{demandeController.selectedDemande.idAcquereur.prenomAcquereur} #{demandeController.selectedDemande.idAcquereur.nomAcquereur}" />

                    </h:panelGrid>
                </p:tab>
                <p:tab title="Pièces jointes">
                    <h:panelGrid columns="4" cellpadding="10">

                        <h:outputText value="Fiche de demande de TMA"
                            style="font-weight:bold" />
                        <h:commandLink action="#{demandeController.displayPj}"
                            value="#{demandeController.ficheDemandeTma.nom}">
                            <f:setPropertyActionListener
                                value="#{demandeController.ficheDemandeTma}"
                                target="#{demandeController.ficheToDisplay}" />
                        </h:commandLink>

                        <h:outputText value="Fiche d'aide à la vente"
                            style="font-weight:bold" />
                        <h:commandLink action="#{demandeController.displayPj}"
                            value="#{demandeController.ficheAideVente.nom}">
                            <f:setPropertyActionListener
                                value="#{demandeController.ficheAideVente}"
                                target="#{demandeController.ficheToDisplay}" />
                        </h:commandLink>

                        <h:outputText value="Plans" style="font-weight:bold" />
                        <h:commandLink action="#{demandeController.displayPj}"
                            value="#{demandeController.plan.nom}">
                            <f:setPropertyActionListener value="#{demandeController.plan}"
                                target="#{demandeController.ficheToDisplay}" />
                        </h:commandLink>

                        <h:outputText value="Chèque d'ouverture de dossier reçu"
                            style="font-weight:bold" />
                        <h:outputText value="#{demandeController.chequeOuverture}" />
                    </h:panelGrid>
                </p:tab>

                <p:tab title="Devis">
                    <h:panelGrid columns="4" cellpadding="10">

                        <h:outputText value="Date de validité du devis"
                            style="font-weight:bold" />
                        <h:outputText
                            value="#{demandeController.selectedDemande.lastDevis.datValidite}">
                            <f:convertDateTime pattern="dd/MM/yyyy" />
                        </h:outputText>

                        <h:outputText value="Date du plan de référence"
                            style="font-weight:bold" />
                        <h:outputText
                            value="#{demandeController.selectedDemande.lastDevis.datPlanReference}">
                            <f:convertDateTime pattern="dd/MM/yyyy" />
                        </h:outputText>

                        <h:outputText value="Frais de dossier" style="font-weight:bold" />
                        <h:outputText
                            value="#{demandeController.selectedDemande.lastDevis.fraDossiers}" />

                        <h:outputText value="Frais de pilotage" style="font-weight:bold" />
                        <h:outputText
                            value="#{demandeController.selectedDemande.lastDevis.fraPilotage}" />

                        <h:outputText value="Frais de plan" style="font-weight:bold" />
                        <h:outputText
                            value="#{demandeController.selectedDemande.lastDevis.fraPlan}" />

                        <h:outputText value="Fiche option" style="font-weight:bold" />
                        <h:outputText
                            value="#{demandeController.selectedDemande.lastDevis.ficOption}" />

                    </h:panelGrid>
                </p:tab>
                <p:tab title="Lignes de chiffrages">
                    <h:panelGrid columns="1" cellpadding="10">

                        <p:dataTable var="ligne"
                            value="#{demandeController.selectedDemande.lastDevis.lignes}"
                            scrollable="true" scrollHeight="100"
                            emptyMessage="Pas de lignes" id="listLignes">

                            <p:column headerText="Lot" style="width: 10%"
                                sortBy="#{ligne.idLot.libelle}" rowspan="2">
                                <h:outputText value="#{ligne.idLot.libelle}" />
                            </p:column>

                            <p:column headerText="Descriptif" style="width: 27%"
                                sortBy="#{ligne.libelleDescriptif}" rowspan="2">
                                <h:outputText value="#{ligne.libelleDescriptif}" />
                            </p:column>

                            <p:column headerText="Charge" style="width: 12%"
                                sortBy="#{ligne.charge}" rowspan="2">
                                <h:outputText value="#{ligne.charge}" />
                            </p:column>

                            <p:column headerText="Qte" style="width: 8%"
                                sortBy="#{ligne.quantite}" rowspan="2">
                                <h:outputText value="#{ligne.quantite}" />
                            </p:column>

                            <p:column headerText="M. unit" style="width: 9%"
                                sortBy="#{ligne.montantUnitaire}" rowspan="2">
                                <h:outputText value="#{ligne.montantUnitaire}" />
                            </p:column>

                            <p:column headerText="M. total" style="width: 10%"
                                sortBy="#{ligne.montantTotal}" rowspan="2">
                                <h:outputText value="#{ligne.montantTotal}" />
                            </p:column>

                            <p:column headerText="Possibilité" style="width: 23%"
                                sortBy="#{ligne.possibilite}" rowspan="2">
                                <h:outputText value="#{ligne.possibilite}" />
                            </p:column>
                        </p:dataTable>

                        <h:panelGrid id="charges" columns="4" cellpadding="10"
                            style="text-align: center;margin-left: 25%;width: 50%; margin-right: 25%; margin-top: 30px; background-color:RGB(225,240,233)">

                            <h:outputText id="chargeSncHt" value="Charge SNC HT"
                                style="font-weight:bold" />
                            <h:outputText for="chargeSncHt"
                                value="#{demandeController.chargeSncHt}">
                                <f:convertNumber maxFractionDigits="2" />
                            </h:outputText>

                            <h:outputText id="chargeAcqHt" value="Charge Acq HT"
                                style="font-weight:bold" />
                            <h:outputText for="chargeAcqHt"
                                value="#{demandeController.chargeAcqHt}">
                                <f:convertNumber maxFractionDigits="2" />
                            </h:outputText>

                            <h:outputText id="chargeSncTtc" value="Charge SNC TTC"
                                style="font-weight:bold" />
                            <h:outputText for="chargeSncTtc"
                                value="#{demandeController.chargeSncTtc}">
                                <f:convertNumber maxFractionDigits="2" />
                            </h:outputText>

                            <h:outputText id="chargeAcqTtc" value="Charge ACQ TTC"
                                style="font-weight:bold" />
                            <h:outputText for="chargeAcqTtc"
                                value="#{demandeController.chargeAcqTtc}">
                                <f:convertNumber maxFractionDigits="2" />
                            </h:outputText>

                        </h:panelGrid>

                    </h:panelGrid>
                </p:tab>
                <p:tab title="Documents">
                    <h:panelGrid columns="5" cellpadding="2" width="100%"
                        style="text-align: center">

                        <h:commandButton title="Générer le devis" id="genDevis"
                            actionListener="#{demandeController.genererDevis}" immediate="true"
                            image="/resources/images/pdf.png"
                            style="vertical-align: middle">
                                Devis convention.pdf
                    </h:commandButton>

                        <p:commandButton title="Plans scannés" id="addPlansScannes"
                            style="vertical-align: middle; width: 130px;"
                            onclick="lazyload()" ajax="true" icon="ui-icon-search"
                            value="Plans scannés">
                            <f:ajax event="click"
                                listener="#{demandeController.onPlansClicked}" />
                        </p:commandButton>

                        <h:commandButton title="Générer le courrier" id="genCourrier"
                            action="#{demandeController.genererCourrier}" immediate="true"
                            image="/resources/images/pdf.png"
                            style="vertical-align: middle">
                                Courrier pour les acquereurs.pdf
                    </h:commandButton>

                        <h:commandButton title="Générer la fiche suiveuse"
                            id="genFicheSuiveuse" action="#{ficheSuiveuseController.init}"
                            immediate="true" 
                            image="/resources/images/excel.png"
                            style="vertical-align: middle">
                        Fiche suiveuse.xls
                        <f:setPropertyActionListener
                                value="#{demandeController.selectedDemande}"
                                target="#{ficheSuiveuseController.selectedDemande}" />
                        </h:commandButton>
                    </h:panelGrid>

                    <h:panelGrid columns="1" cellpadding="10" width="100%"
                        style="text-align: center" id="lazypanel">

                        <p:dataTable id="plansDT" var="plan"
                            value="#{demandeController.listPlansScannes}"
                            rendered="#{demandeController.plansClicked}"
                            emptyMessage="Pas de Plan">

                            <p:column headerText="Plans" style="width: 100%"
                                sortBy="#{plan.nom}">


                                <h:commandLink action="#{demandeController.displayFiles}"
                                    value="#{plan.nom}">
                                    <f:setPropertyActionListener value="#{plan}"
                                        target="#{demandeController.ficheToDisplay}" />
                                </h:commandLink>

                            </p:column>

                        </p:dataTable>
                    </h:panelGrid>

                    <p:remoteCommand name="lazyload" update="lazypanel"
                        actionListener="#{demandeController.onPlansClicked()}">
                    </p:remoteCommand>

                </p:tab>
            </p:accordionPanel>

        </p:dialog>
 </p:form>

EDIT

When I inspect the element I get this:

<input id="detailsDemandesForm:displayDem:genDevis" type="image" title="Générer le devis" style="vertical-align: middle" name="detailsDemandesForm:displayDem:genDevis" src="/workflowtma-presentation-war/resources/images/pdf.png"></input>


                                    Devis convent…

  • 1
    Obligatory link: http://stackoverflow.com/a/2120183/785663 check if one of these issues may be responsible. Also, you mean *no* button is working? Plus, some of your code is dubious: `` doesn't support `ajax` as an attribute. – mabi Mar 31 '14 at 08:25
  • @mabi thanks, I removed the ajax attribute, and I still have the same issue, I edited my post – Safwen Khalloufi Mar 31 '14 at 08:50

1 Answers1

0

From a quick glance your issue might be caused by No. 1 of the list of such problems.

In particular your use of appendToBody="true" makes me suspect that Primefaces is moving your dialog out of the <p:form> you declared it in. Try moving the form inside the dialog like so:

<p:dialog ...>
  <p:form>
    <!-- content goes here -->
  </p:form>
</p:dialog>
Community
  • 1
  • 1
mabi
  • 5,279
  • 2
  • 43
  • 78