primefaces north layout unit disappears on dialogue's resize - jsf

i was developing my jsf web app using primefaces framework, and i come across to this strange behavior, when i resize the dialogue on my page the north layout unit disappears, what is more strange is when i resize the inspector on any browser it does same bizarre behavior , it just disappears, i wanna know what i'm doing wrong.
here a some substantial code :
<h:body>
<f:view>
<h:form id="form1">
<p:layout id="layout">
<p:layoutUnit id="north" position="north" resizable="false" header="Recherche avancé" collapsible="false" effect="drop" collapsed="false" size="140">
<p:panelGrid columns="4" styleClass="prince">
<p:panel styleClass="centeredPanelDate" header="Dates">
<p:panelGrid styleClass="centeredPanelDatePan" columns="2">
<p:selectOneMenu id="stater" value="#{dyna.dateOption}" style=" height:20px!important;
width: 140px;
font-family: klavika_boldbold;">
<f:selectItems value="#{dyna.etatdateOptions}"/>
</p:selectOneMenu>
</p:panelGrid>
<p:panelGrid columns="2" >
<p:column>
<p:outputLabel id="lab1" value= "De : " for="popupButtonCal1" />
<p:outputLabel id="lab2" value= "A : " for="popupButtonCal2"/>
</p:column>
<p:column>
<p:calendar value="#{dyna.startdate}"
id="popupButtonCal1"
validatorMessage="format de date invalide"
pattern="dd/MM/yyyy HH:mm"
mode="popup"
locale="fr"
navigator="true"
effect="show"
mindate="01/01/1988"
maxdate="31/12/2030"
showButtonPanel="true"
styleClass="calo"/>
<br></br>
<p:calendar value="#{dyna.enddate}"
id="popupButtonCal2"
validatorMessage="format de date invalide"
pattern="dd/MM/yyyy HH:mm"
mode="popup"
locale="fr"
navigator="true"
effect="show"
mindate="01/01/1988"
maxdate="31/12/2030"
showButtonPanel="true"
styleClass="calo"/>
</p:column>
</p:panelGrid>
<p:tooltip for="popupButtonCal1" value="Date de debut (selectionner une date sur la calendrier" showEffect="clip" hideEffect="clip"/>
<p:tooltip for="popupButtonCal2" value="Date de fin (selectionner une date sur la calendrier" showEffect="clip" hideEffect="clip"/>
</p:panel>
<p:panel styleClass="listsPanel" header="Listes">
<p:panelGrid styleClass="centeredPanelDatePan1" columns="3" >
<p:column>
<p:selectCheckboxMenu label="Etat" value="#{dyna.selectedstateOptions}" style=" height:18px!important;width: 100px;font-family: klavika_boldbold; ">
<f:selectItems value="#{dyna.etatExamOptions}" />
</p:selectCheckboxMenu>
</p:column>
<p:column >
<p:selectCheckboxMenu label="Payement" value="#{dyna.selectedpayOptions}" style=" height:18px!important;width: 100px;font-family: klavika_boldbold;">
<f:selectItems value="#{dyna.payExamOptions}" />
</p:selectCheckboxMenu>
</p:column>
<p:column >
<p:selectCheckboxMenu label="Salle" value="#{dyna.selectedsalleOptions}" style=" height:18px!important;width: 100px;font-family: klavika_boldbold;">
<f:selectItems value="#{dyna.salleOptions}" />
</p:selectCheckboxMenu>
</p:column>
</p:panelGrid>
</p:panel>
<p:panel styleClass="param" header="Paramètre resultat">
<p:panelGrid styleClass="param1" columns="3" >
<p:column>
<p:inputText id="txt1" value="#{dyna.number1}" />
<p:slider id ="sld" for="txt1" minValue="10" maxValue="1000" />
</p:column>
<h:column>
<p:commandButton id="searchdate" value="Rechercher" actionListener="#{dyna.search}" style="height:30px!important"/>
</h:column>
</p:panelGrid>
<p:tooltip for="txt1" value="spécifier le nombre des lignes à obtenir de la base de données (grand nombre prend plus du temps)" showEffect="clip" hideEffect="clip"/>
</p:panel>
<p:panel styleClass="userPanel" header="Données utilisateur">
<p:panelGrid styleClass="userPanelContent" columns="1">
<p:commandButton id="userbtn" value="Utilisateur" style="width: 100px!important;"/>
<p:commandButton id="colsshow" value="Colonnes" style="width: 100px!important;"/>
</p:panelGrid>
</p:panel>
<p:growl id="msg" showDetail="true"/>
</p:panelGrid>
</p:layoutUnit>
<br></br>
<p:layoutUnit id="cent"
position="center"
resizable="true"
collapsible="true"
effect="drop"
size="300"
styleClass="heighter">
....... all tags closed respectfully.
and thank you all.

Set appendToBody="true" on p:dialog when using with p:layout.

Related

Why my <p:dataExporter> doesn't work?

I made my code like de PF Showcase, but it does't works... When i click my commandLink nothing happens. Anyone can help me? I already added Apache POI and iText.
<h:form id="form">
<p:commandButton value="Novo" icon="ui-icon-document"
actionListener="#{controleBean.novoReservatorio()}" process="#this"
update="dataTable reservatorio-dialog"
oncomplete="PF('reservatorioDialog').show()" class="botaoDataTable">
<p:resetInput target="reservatorio-dialog" />
</p:commandButton>
<p:commandButton icon="ui-icon-pencil" id="btnEditar" title="Editar"
disabled="#{controleBean.reservatorio == null}"
class="botaoDataTable" process="#this" update="dataTable :form"
oncomplete="PF('reservatorioDialog').show()">
<p:resetInput target="reservatorio-dialog" />
<f:setPropertyActionListener target="#{controleBean.reservatorio}"
value="#{controleBean.reservatorioSelecao}" />
</p:commandButton>
<p:commandButton icon="ui-icon-trash" id="btnExcluir"
title="Excluir" disabled="#{controleBean.reservatorio == null}"
class="botaoDataTable" action="#{controleBean.excluirReservatorio}"
process="#this" update="dataTable btnExcluir btnEditar" />
<p:dataTable var="r" value="#{controleBean.reservatorios}"
paginator="true" rows="30" id="dataTable"
emptyMessage="Nenhum Reservatorio Cadastrado"
paginatorPosition="bottom"
selection="#{controleBean.reservatorioSelecao}"
selectionMode="single" rowKey="#{r.idReservatorio}">
<p:ajax event="rowSelect"
update=":form:btnEditar :form:btnExcluir" />
<p:ajax event="rowUnselect"
update=":form:btnEditar :form:btnExcluir" />
<p:column headerText="Nome">
<h:outputText value="#{r.nomeReservatorio}" />
</p:column>
<p:column headerText="Capacidade (Lt)">
<h:outputText value="#{r.capacidadeReservatorio}" />
</p:column>
<p:column headerText="Tipo">
<h:outputText value="#{r.tipoReservatorio}" />
</p:column>
<p:column headerText="Observação">
<h:outputText value="#{r.obsReservatorio}" />
</p:column>
</p:dataTable>
<p:commandLink>
<p:graphicImage library="img" name="xlsx.png" width="32" title="Exportar para Excel"/>
<p:dataExporter type="xls" target="dataTable" fileName="Relatorio" />
</p:commandLink>
<h:commandLink>
<p:graphicImage library="img" name="pdf.png" width="37" title="Exportar para PDF"/>
<p:dataExporter type="pdf" target="dataTable" fileName="Relatorio"/>
</h:commandLink>
<p:commandButton value="Exportar para PDF" ajax="false">
<p:dataExporter type="pdf" target=":form:dataTable" fileName="dataTable" />
</p:commandButton>
<p:dialog header="Reservatório" widgetVar="reservatorioDialog"
id="reservatorio-dialog" resizable="false" modal="true"
closeOnEscape="true">
<p:messages style="font-size:70%;" />
<p:panelGrid styleClass="semBorda">
<p:row>
<p:column>
<h:outputLabel for="nomeReservatorio" value="* Nome: "
class="componentePF label" />
</p:column>
<p:column>
<p:inputText id="nomeReservatorio" required="true"
value="#{controleBean.reservatorio.nomeReservatorio}"
requiredMessage="É necessário atribuir um nome à reservatorio"
class="componentePF text" />
</p:column>
</p:row>
<p:row>
<p:column>
<h:outputLabel for="capacidadeReservatorio"
value="* Capacidade (Lt): " class="componentePF label" />
</p:column>
<p:column>
<p:spinner id="capacidadeReservatorio" size="30"
value="#{controleBean.reservatorio.capacidadeReservatorio}"
min="0" stepFactor="1" required="true"
requiredMessage="É necessário atribuir uma capacidade à reservatorio"
class="componentePF text" />
</p:column>
</p:row>
<p:row>
<p:column>
<h:outputLabel for="tipoReservatorio"
value="* Tipo de Reservatório: " class="componentePF label" />
</p:column>
<p:column>
<p:selectOneMenu id="tipoReservatorio" style="font-size:75% !important;"
value="#{controleBean.reservatorio.tipoReservatorio}"
class="componentePF text bold" required="true"
requiredMessage="É necessário atribuir um tipo ao reservatório">
<f:selectItem itemLabel="Escolha um Tipo para o Reservatório"
noSelectionOption="true" />
<f:selectItem itemLabel="Escoamento" itemValue="Escoamento" />
<f:selectItem itemLabel="Reserva" itemValue="Reserva" />
</p:selectOneMenu>
</p:column>
</p:row>
<p:row>
<p:column>
<h:outputLabel for="obsReservatorio" value="Observação: "
class="componentePF label" />
</p:column>
<p:column>
<p:inputText id="obsReservatorio"
value="#{controleBean.reservatorio.obsReservatorio}"
class="componentePF text" />
</p:column>
</p:row>
<p:row>
<p:column colspan="2">
<p:commandButton value="Cadastrar" icon="ui-icon-disk"
action="#{controleBean.cadastrarReservatorio}"
id="cadastrarReservatorio" ajax="false"
class="componentePF button" />
</p:column>
</p:row>
</p:panelGrid>
</p:dialog>
</h:form>
The first <p:commandLink> doesn't work be cause it sends an ajax request. Just add ajax="false" to solve the problem.
See https://stackoverflow.com/a/7740280/1980659 for the root cause explanation.
With what you provided the two other buttons should work.

Why my dialogs doesn't work?

I have a dialog that open when the page is reloaded and ask for the login. This was working perfectly until I create another dialog that open when I click in a button. Both have different names and I am calling then right! I really don't know what is wrong..
Now, when I reload the page it shows me the login dialog and I put the right login and password but it rejects.. But if I remove the other dialog and do the same thinh, it works.
My code:
<body onload="PF('dlgLogin').show();">
<h:form name="">
<p:growl id="growl" sticky="true" showDetail="true" life="2000" />
<p:dialog header="Login" widgetVar="dlgLogin" modal="true" closable="false" resizable="false">
<h:panelGrid columns="2" cellpadding="5">
<h:outputLabel for="login" value="Username:" />
<p:inputText id="login" value="#{loginView.login}" required="true" label="Login" />
<h:outputLabel for="password" value="Password:" />
<p:password id="password" value="#{loginView.senha}" required="true" label="Password" />
<f:facet name="footer">
<p:commandButton value="Login" update="growl" action="#{loginView.login}"
oncomplete="handleLoginRequest(xhr, status, args)" />
</f:facet>
</h:panelGrid>
</p:dialog>
<p:dialog header="Nova classificação" widgetVar="dlgClassificacao" modal="true" resizable="false">
<h:panelGrid columns="2" cellpadding="5">
<h:outputLabel for="nome" value="Nome:" />
<p:inputText id="nome" value="#{adminView.classNome}" required="true" label="Nome" />
<h:outputLabel for="valor" value="Valor:" />
<p:inputText id="valor" value="#{adminView.classPreco}" required="true" label="Valor" />
</h:panelGrid>
<f:facet name="footerAdicionar">
<p:commandButton value="Adicionar" action="#{adminView.novaClassificacao}" />
</f:facet>
</p:dialog>
<p:layout>
<p:layoutUnit position="center">
<p:dataTable id="classificacoes" selection="#{adminView.selectedClassificacao}" var="classificacao" value="#{adminView.classificacoes}" style="margin-bottom:20px">
<p:ajax event="rowSelect" listener="#{adminView.onRowSelect}"/>
<p:column>
<f:facet name="header">
<h:outputText value="Nome" />
</f:facet>
<h:outputText value="#{classificacao.nome}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Valor" />
</f:facet>
<h:outputText value="#{classificacao.preco}" />
</p:column>
</p:dataTable>
<f:facet name="footer">
<p:commandButton title="Novo" icon="ui-icon-document" onclick="PF('dlgClassificacao').show();" type="button"/>
<p:commandButton title="Editar" icon="ui-icon-pencil" />
<p:commandButton title="Deletar" icon="ui-icon-trash" update="classificacoes" actionListener="#{adminView.excluirClassificacao}"/>
</f:facet>
</p:layoutUnit>
</p:layout>
</h:form>
<script type="text/javascript">
function handleLoginRequest(xhr, status, args) {
if(args.validationFailed || !args.loggedIn) {
PF('dlg').jq.effect("shake", {times:5}, 100);
}
else {
PF('dlg').hide();
$('#loginLink').fadeOut();
}
}
</script>
</body>
The problem is that you are sending all the form data when you press the login button. Then you obtain messages indicating that you have not (naturally) typed any data for Nome nor Valor fields.
You can fix it by adding an id attribute to your login dialog and to your form and also adding a process attribute to your login button:
<p:commandButton process=":yourForm:dlgLogin" value="Login"
update="growl" action="#{loginView.login}" />

p:contextMenu within p:dataTable in PrimeFaces

I have a problem related to a <p:contextMenu> within a <p:dataTable> of PrimeFaces. There is a <p:commandLink> and also some command buttons within columns in this table, when I open the context menu automatically inserted is the value of that column my variable, but the problem is this when I open this <p:contexMenu> menu by clicking the right button on top of one of these link command or command button the value of this column is not passed to variable.
This is my code.
<h:form id="form-arquivo-listar">
<p:contextMenu id="menuArquivos" for="dataArquivos">
<p:menuitem value="Baixar" icon="ui-icon-disk" url="../../arquivos/#{arquivoBean.arquivoSelecionado.nome}" target="arquivo"/>
<p:menuitem value="Excluir" icon="ui-icon-close" actionListener="#{arquivoBean.excluir()}" update="form-arquivo-listar"/>
<p:menuitem value="Transferir" icon="ui-icon-extlink" actionListener="#{arquivoBean.getPastas()}" update=":formArquivoTransferir:treeArquivos" oncomplete="PF('arquivoTransferirDialog').show()"/>
</p:contextMenu>
<p:menubar model="#{arquivoBean.menu}"/>
<p:dataTable id="dataArquivos" value="#{arquivoBean.objetos}" var="o" rowKey="#{o.id}" selection="#{arquivoBean.arquivoSelecionado}" selectionMode="single" styleClass="ui-datatable-no-border">
<f:facet name="header">#{text['arquivo.pagina.listar.titulo']}</f:facet>
<p:column style="width: 20px">
<i class="#{o.tipo.icone}"></i>
</p:column>
<p:column headerText="#{text['arquivo.pagina.form.nome']}" rendered="#{o.tipo.id != 5}">
<p:link value="#{o.nomeOriginal}" href="../../arquivos/#{o.nome}" target="arquivo">
</p:link>
</p:column>
<p:column headerText="#{text['arquivo.pagina.form.nome']}" rendered="#{o.tipo.id == 5}">
<p:commandLink styleClass="link" id="link" value="#{o.nomeOriginal}" actionListener="#{arquivoBean.alterarPasta(o.id)}" update=":form-arquivo-listar" >
</p:commandLink>
</p:column>
<p:column headerText="#{text['arquivo.pagina.form.publico']}" style="width: 50px">
<h:outputText value="#{o.publico ? 'Sim' : 'Não'}" rendered="#{o.tipo.id != 5}"/>
</p:column>
<p:column style="width: 26px">
<p:commandButton id="editarButton" title="Exibir" icon="ui-icon-search" update=":form-arquivo-listar:arquivo-detalhes" oncomplete="PF('arquivoDialog').show()" rendered="#{o.tipo.id != 5}">
<f:setPropertyActionListener value="#{o}" target="#{arquivoBean.objeto}" />
</p:commandButton>
</p:column>
<p:column style="width: 26px">
<p:commandButton icon="ui-icon-pencil" oncomplete="PF('cadastroArquivo').show()">
<f:setPropertyActionListener value="#{o}" target="#{arquivoBean.objeto}" />
</p:commandButton>
</p:column>
<p:column style="width: 26px">
<p:commandButton id="excluirButton" title="#{text['arquivo.pagina.form.confirmacao.botao.titulo']}" icon="ui-icon-close" update=":form-arquivo-listar" actionListener="#{arquivoBean.excluir(o.id)}">
<p:confirm header="#{text['arquivo.pagina.form.confirmacao.titulo']}" icon="ui-icon-alert" message="#{text['arquivo.pagina.form.confirmacao.mensagem']}" />
</p:commandButton>
<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
<p:commandButton icon="ui-icon-check" value="#{text['arquivo.pagina.form.confirmacao.sim']}" type="button" styleClass="ui-confirmdialog-yes" />
<p:commandButton icon="ui-icon-close" value="#{text['arquivo.pagina.form.confirmacao.nao']}" type="button" styleClass="ui-confirmdialog-no" />
</p:confirmDialog>
</p:column>
</p:dataTable>
<p:dialog id="arquivo-detalhes" widgetVar="arquivoDialog">
<h:panelGrid columns="2" cellpadding="4" style="margin:0 auto;">
<h:outputLabel value="#{text['arquivo.pagina.form.id']}:" />
<h:outputText value="#{arquivoBean.objeto.id}" />
<h:outputLabel value="#{text['arquivo.pagina.form.arquivo']}:" />
<h:graphicImage value="../../arquivos/#{arquivoBean.objeto.nome}" width="200" rendered="#{arquivoBean.isImagem()}" />
<p:media value="../../arquivos/#{arquivoBean.objeto.nome}" width="200" height="80" player="quicktime" rendered="#{arquivoBean.isAudio()}" />
<p:media value="../../arquivos/#{arquivoBean.objeto.nome}" width="300" height="300" rendered="#{arquivoBean.isVideo()}"/>
</h:panelGrid>
</p:dialog>
</h:form>
<p:dialog id="arquivoTransferirDialog" widgetVar="arquivoTransferirDialog">
<h:form id="formArquivoTransferir">
<p:growl id="msg" showDetail="false"/>
<h:panelGrid columns="1">
<p:tree id="treeArquivos" value="#{arquivoBean.raiz}" var="arquivo" selection="#{arquivoBean.raizSelecionada}" selectionMode="single">
<p:treeNode expandedIcon="ui-icon ui-icon-folder-open" collapsedIcon="ui-icon ui-icon-folder-collapsed">
<h:outputText value="#{arquivo.nomeOriginal}" />
</p:treeNode>
</p:tree>
<h:panelGrid columns="2">
<p:commandButton value="Transferir" actionListener="#{arquivoBean.transferirArquivo()}" oncomplete="PF('arquivoTransferirDialog').hide()" update="formArquivoTransferir, :form-arquivo-listar:dataArquivos"/>
<p:commandButton value="Cancelar" onclick="PF('arquivoTransferirDialog').hide()"/>
</h:panelGrid>
</h:panelGrid>
</h:form>
</p:dialog>
<p:dialog id="arquivoCriarPasta" widgetVar="arquivoCriarPasta">
<h:form id="formCriarPasta">
<p:growl id="msg" showDetail="false"/>
<h:panelGrid columns="2">
<h:outputText value="Nome" />
<p:inputText value="#{arquivoBean.objeto.nomeOriginal}" required="true"/>
<h:column/>
<h:panelGrid columns="2">
<p:commandButton value="Salvar" actionListener="#{arquivoBean.salvarPasta()}" update="formCriarPasta,:form-arquivo-listar:dataArquivos" oncomplete="PF('arquivoCriarPasta').hide()"/>
<p:commandButton value="Cancelar" onclick="PF('arquivoCriarPasta').hide()"/>
</h:panelGrid>
</h:panelGrid>
</h:form>
</p:dialog>
<p:dialog id="cadastroArquivo" header="#{text['arquivo.pagina.editar.titulo']}" widgetVar="cadastroArquivo" >
<h:form id="form-arquivo-editar" enctype="multipart/form-data">
<p:growl id="msg" showDetail="false"/>
<h:inputHidden value="#{arquivoBean.objeto.id}" rendered="#{arquivoBean.objeto.id!=null}" />
<h:panelGrid columns="2" style="margin:20px">
<p:outputLabel value="#{text['arquivo.pagina.form.arquivo']}" for="inputArquivo" />
<p:fileUpload id="inputArquivo" value="#{arquivoBean.file}" required="true" label="#{text['arquivo.pagina.form.arquivo']}" mode="simple"
disabled="#{arquivoBean.objeto.id!=null and arquivoBean.objeto.id!=0}" />
<p:outputLabel value="#{text['arquivo.pagina.form.nome']}" rendered="#{arquivoBean.objeto.id!=null and arquivoBean.objeto.id!=0}" />
<h:outputText value="#{arquivoBean.objeto.nomeOriginal}" rendered="#{arquivoBean.objeto.id!=null and arquivoBean.objeto.id!=0}" />
<p:outputLabel value="#{text['arquivo.pagina.form.descricao']}" for="inputDescricao" />
<p:inputTextarea id="inputDescricao" value="#{arquivoBean.objeto.descricao}" />
<p:outputLabel value="#{text['arquivo.pagina.form.publico']}" for="inputPublico" />
<p:selectBooleanCheckbox id="inputPublico" value="#{arquivoBean.objeto.publico}" />
<p:outputLabel value="#{text['arquivo.pagina.form.tipo']}" for="inputTipo" />
<p:selectOneMenu id="inputTipo" value="#{arquivoBean.objeto.tipo}" required="true" label="#{text['arquivo.pagina.form.tipo']}"
converter="#{arquivoTipoBean.converter()}">
<f:selectItem itemLabel="#{text['arquivo.pagina.form.tipo.default']}" />
<f:selectItems value="#{arquivoTipoBean.selectObjetos}" />
</p:selectOneMenu>
</h:panelGrid>
<h:panelGrid columns="2" style="margin-bottom:10px">
<p:commandButton value="#{text['arquivo.pagina.form.salvar']}" update=":form-arquivo-editar,:form-arquivo-listar"
process="#form" actionListener="#{arquivoBean.salvar}" ajax="false" />
</h:panelGrid>
</h:form>
</p:dialog>

JSF: Nothing happens when a button clicked

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…
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>

Avoid refresh the whole page after submit

in the code below there is a form with the name of FormData where every time I submit the data, it updates the entire page. I wish this did not happen when submit the data, it would execute the action q without refreshing the whole page. This behavior is normal or I'm doing something wrong?
My code:
<ui:decorate template="/resources/Template.xhtml">
<ui:define id="content" name="content">
<p:growl id="war"/>
<style type="text/css">
.ok{
color: #336600
}
.erro{
color: #D20005;
}
</style>
<div style="width: 90%; margin-left: auto; margin-right: auto; ">
<br/>
<br/>
<p:panel>
<f:facet name="header">
Lista de Arquivos Armazenados
</f:facet>
<h:form id="pesquisar">
<p:toolbar style="width: 100%;">
<p:toolbarGroup align="left" >
<h:panelGrid columns="1" cellpadding="0">
</h:panelGrid>
</p:toolbarGroup>
<p:toolbarGroup align="right">
<h:panelGrid columns="5" cellpadding="0">
<h:outputLabel value="De: "/>
<p:inputMask mask="99/99/9999" value="#{arquivoBean.dataInicial}" size="10"/>
<h:outputLabel value="Até: "/>
<p:inputMask mask="99/99/9999" value="#{arquivoBean.datafinal}" size="10"/>
<p:commandButton value="Buscar" action="#{arquivoBean.listar()}" ajax="false"/>
<br/>
<p:selectBooleanCheckbox id="check" value="#{arquivoBean.pendente}"
itemLabel="Pendente">
<p:ajax process="#this" event="change" listener="#{arquivoBean.listarPendente()}" />
</p:selectBooleanCheckbox>
</h:panelGrid>
</p:toolbarGroup>
</p:toolbar>
</h:form>
</p:panel>
<br/>
<p:dataTable id="dataTable"
var="Arquivo"
paginator="true"
paginatorPosition="bottom"
rowsPerPageTemplate="100"
rows="100"
sortBy="#{Arquivo.id}"
value="#{arquivoBean.dataModelArquivo}"
rowStyleClass="#{Arquivo.pendente eq 1 ? 'ok' : 'erro'}"
emptyMessage="Você ainda não ativou uma empresa ou não existe postagem para esta Empresa">
<p:column headerText="ID">
#{Arquivo.id}
</p:column>
<p:column headerText="Nome">
#{Arquivo.nomeMury}
</p:column>
<p:column headerText="Envio">
#{Arquivo.dataEnvio}
</p:column>
<p:column headerText="Produto" width="10px;">
<h:form id="formProduto">
<p:commandButton icon="ui-icon-circle-zoomout" value=""
action="#{arquivoBean.listarProdutoPorArquivo()}"
oncomplete="prodDialog.show()"
onclick="listarProd([{name: 'ArquivoId', value:#{Arquivo.id}}]);">
<f:setPropertyActionListener value="#{Arquivo}" target="#{arquivoBean.arquivo}"/>
</p:commandButton>
<p:remoteCommand name="listarProd" action="#{arquivoBean.listarProdutoPorArquivo()}" update=":formDataTable:dataTableProd">
<f:setPropertyActionListener value="#{Arquivo}" target="#{arquivoBean.arquivo}"/>
</p:remoteCommand>
</h:form>
</p:column>
<p:column headerText="Data" width="10px;">
<h:form id="formData">
<p:inputMask id="entrada#{cc.clientId}" mask="99/99/9999" value="#{Arquivo.dataEntrada}"
onkeypress="if (event.keyCode === 13) {
test([{name: 'rowIndex', value:#{Arquivo.id}}]);
return;
}"
size="8">
<f:convertDateTime pattern="dd/MM/yyyy" type="date" timeZone="GMT-03:00"/>
</p:inputMask>
<p:remoteCommand name="test" action="#{arquivoBean.inserirDataNota()}">
<f:setPropertyActionListener value="#{Arquivo}" target="#{arquivoBean.arquivo}"/>
</p:remoteCommand>
</h:form>
</p:column>
</p:dataTable>
<h:form id="formDataTable">
<p:dialog closeOnEscape="true"
widgetVar="prodDialog"
modal="true"
header="Lista de Produtos da NF-e"
style="width: 300; height: 500"
position="center">
<p:dataTable
id="dataTableProd"
var="XmlItens"
paginator="true"
paginatorPosition="bottom"
rowsPerPageTemplate="10"
rows="10"
value="#{arquivoBean.listaProd}">
<p:column headerText="ID">
#{XmlItens.id}
</p:column>
<p:column headerText="Nome">
#{XmlItens.descricaoProd}
</p:column>
<p:column headerText="Envio">
#{XmlItens.chaveNfe}
</p:column>
</p:dataTable>
</p:dialog>
</h:form>
</div>
</ui:define>
</ui:decorate>
First: The method on your managedBean must be void or return a String null
Second: you must write which ones components do you want to update after de action works.
Like primefaces example:
https://www.primefaces.org/showcase/ui/ajax/remoteCommand.xhtml

Resources