Olá Pessoal,
Estou com o seguinte problema. Tenho um primeiro p:dialog e nele eu tenho um p:datatable(uma lista de dias). Para incluir um novo dia eu abro um novo p:dialog(que vai adicionar um dia no p:datable). Quando eu utilizo os atributos modal=“true” appendTo="@(body)" no segundo dialogo as informações digitadas nele chegam nulas no bean.
Obrigado,
<html xmlns:c="http://java.sun.com/jsp/jstl/core">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<f:view contentType="text/html; charset=ISO-8859-1">
<p:dialog widgetVar="DlgEdit" header="Editar FA"
position="center" width="80%">
<h:form id="FrmEdit">
<script type="text/javascript" src="../../../../resources/js/jquery.price_format.js"></script>
<script type="text/javascript" src="../../../../resources/js/locale-primefaces.js" ></script>
<p:panel id="PnlEdit" header="Dados da FA - #{fichaApropFace.selectedLinha.numfa}" style="background-color: #dddddd">
<p:commandButton style="height: 40px; width: 120px;" title="Salvar"
process="@form"
action="#{fichaApropFace.doFinishEdit()}" alt="Salvar registro"
update=":FrmList:Dtb,:FrmList:FrmEdit:PnlEdit"
value="Salvar" icon="fa fa-check Fs12 white"
oncomplete="if (!args.validationFailed) PF('DlgEdit').hide()"/>
<p:spacer width="2" height="2"/>
<p:commandButton style="height: 40px; width: 120px;" immediate="true"
title="Voltar para lista"
alt="Voltar para lista"
value="Voltar" icon="fa fa-undo Fs12 white"
onclick="PF('DlgEdit').hide();"/>
<p:spacer width="2" height="2"/>
<p:messages id="messages" autoUpdate="true" closable="true" />
<p:tabView id="Tbv" activeIndex="${fichaApropFace.activTab}"
style="background-color: #dddddd">
<p:tab title="Dados gerais">
<ui:include src="/views/projetos/operacoes/fichaaprop/capa.xhtml"/>
</p:tab>
<p:tab title="Dias">
<p:panel>
<p:toolbar>
<f:facet name="left">
<table>
<tr>
<td>
<p:commandButton style="height: 30px; width: 120px;" title="Incluir"
action="#{diasFAFace.doCreate()}"
oncomplete="PF('DlgAddDia').show()"
process="@this" update="FrmAddDia:PnlGrpAddDia"
alt="Incluir registro" value="Incluir" icon="fa fa-plus Fs12 white">
<p:resetInput target="FrmAddDia:PnlGrpAddDia"/>
</p:commandButton>
</td>
<td width="400px">
<p:messages id="MsgDia" autoUpdate="true" closable="true"/>
</td>
</tr>
</table>
</f:facet>
</p:toolbar>
<p:dataTable var="item" value="#{diasFAFace.list}"
id="DtbDia"
paginator="true" rows="5" paginatorPosition="top"
emptyMessage="Não há registros a exibir"
rowStyleClass="#{empty rowIx or rowIx mod 2 ne 0 ? 'even-row' : 'odd-row'}"
rowIndexVar="rowIx"
style="font-size: 10px">
<p:column style="width:16px">
<p:rowToggler/>
</p:column>
<p:column headerText="Data">
<h:outputText value="#{item.datamovto}">
<f:convertDateTime pattern="dd/MM/yyyy" locale="pt_BR"/>
</h:outputText>
</p:column>
<p:column headerText="Ação" style="width: 100px; overflow: hidden; text-align: center">
<p:commandButton style="height: 30px; width: 30px;"
alt="Alterar registro" title="Alterar"
process="@this" oncomplete="PF('DlgEditDia').show()"
id="bt_editar" icon="fa fa-pencil Fs16 white">
<f:setPropertyActionListener target="#{diasFAFace.selectedLinha}" value="#{item}"/>
</p:commandButton>
<p:spacer width="2" height="2"/>
<p:commandButton style="height: 30px; width: 30px;"
styleClass="RedButton"
alt="Deletar registro" process="@this"
action="#{diasFAFace.doRemove()}" title="Deletar" icon="fa fa-trash Fs16 white">
<f:setPropertyActionListener target="#{diasFAFace.selectedLinha}" value="#{item}"/>
</p:commandButton>
</p:column>
</p:dataTable>
<p:dialog widgetVar="DlgAddDia" header="Adicionar dia"
position="center" modal="true" appendTo="@(body)"
style="font-size: 10px; min-width: 400px">
<h:form id="FrmAddDia">
<h:panelGroup id="PnlGrpAddDia" layout="block" styleClass="ui-fluid">
<p:messages id="MsgAddDia" autoUpdate="false" />
<p:panelGrid columns="2" layout="grid"
rendered="#{diasFAFace.selectedBean != null}"
columnClasses="ui-grid-col-3, ui-grid-col-9"
style="border: none !important;">
<p:outputLabel value="Pacote" for="pacoteAdd"/>
<p:selectOneMenu id="pacoteAdd" value="#{diasFAFace.selectedBean.pacote}">
<f:selectItems var="itemSel" itemLabel="#{itemSel.descricao}"
itemValue="#{itemSel}" value="#{componenteeapFace.listPacoteRecurso}"/>
<f:converter converterId="componenteeapConverter"/>
</p:selectOneMenu>
<p:outputLabel value="Data" for="dataAdd"/>
<p:calendar value="#{diasFAFace.selectedBean.datamovto}"
pattern="dd/MM/yyyy" locale="pt_BR"
navigator="true" id="dataAdd"
style="width: 125px"/>
<p:outputLabel value="Hora inicial" for="hriniAdd" style="color: red"/>
<p:inputText id="hriniAdd" value="#{diasFAFace.selectedBean.hrinicialrelogio}"
onfocus="jQuery('.hora').priceFormat({prefix : ' ',
centsSeparator: ':',
centsLimit: 2});"
styleClass="hora" style="text-align: right"/>
<p:outputLabel value="Hora final" style="color: red" for="hrfimAdd"/>
<p:inputText id="hrfimAdd" value="#{diasFAFace.selectedBean.hrfinalrelogio}"
onfocus="jQuery('.hora').priceFormat({prefix : ' ',
centsSeparator: ':',
centsLimit: 2});"
styleClass="hora" style="text-align: right"/>
<p:outputLabel value="Descanso" style="color: red" for="descansoAdd"/>
<p:inputText value="#{diasFAFace.selectedBean.hrintervalorelogio}" id="descansoAdd"
onfocus="jQuery('.hora').priceFormat({prefix : ' ',
centsSeparator: ':',
centsLimit: 2});"
styleClass="hora" style="text-align: right"/>
<p:outputLabel value="Descrição" for="descricaoAdd" style="color: red"/>
<p:inputTextarea cols="40" rows="5" id="descricaoAdd"
value="#{diasFAFace.selectedBean.descricao}"/>
<p:commandButton value="Salvar" style="height: 30px; width: 85px;"
id="bt_salvarAdd" process="FrmAddDia:PnlGrpAddDia"
update="FrmAddDia:PnlGrpAddDia"
action="#{diasFAFace.doFinishCreate()}"
oncomplete="PF('DlgAddDia').hide();">
</p:commandButton>
<p:commandButton value="Cancelar" style="height: 30px; width: 85px;"
immediate="true" id="bt_cancelarAdd"
onclick="PF('DlgAddDia').hide();">
</p:commandButton>
</p:panelGrid>
</h:panelGroup>
</h:form>
</p:dialog>
</p:panel>
</p:tab>
</p:tabView>
</p:panel>
</h:form>
</p:dialog>
</f:view>
</ui:composition>
</html>