Infelizmente appendToBody=“true” nao funcionou 
segue o meu xhtml
<h:body>
<p:ajaxStatus style="width:5px;height:5px;top: 200px;position: relative;">
<f:facet name="start">
<h:graphicImage value="loading.gif" />
</f:facet>
<f:facet name="complete">
<h:outputText value="" />
</f:facet>
</p:ajaxStatus>
<h:form id="form">
<f:metadata>
<f:event type="preRenderView" listener="#{atenderChamado.AtualizarTabelas()}"/>
</f:metadata>
<div id="tela_todos" align="left">
<p:panel header="Filtros" toggleable="true" toggleSpeed="500" closeSpeed="2000" widgetVar="panelFiltros">
<h:panelGrid columns="6" cellpadding="5">
<h:outputLabel id="latender" value="Grupo:"/>
<p:selectOneMenu id="sOMatender" value="#{atenderChamado.filtrosAtender.idTipoChamado}" height="100" required="true" >
<f:selectItem itemLabel="Todos Grupo(s)" itemValue="0" />
<f:selectItems id="fsAtender" value="#{atenderChamado.listaTipoChamado(telaLogin.idUsuario)}"
var="item" itemLabel="#{item.descricao}"
itemValue="#{item.id}" />
</p:selectOneMenu>
<h:outputLabel value="De"/>
<p:calendar locale="pt" pattern="dd/MM/yyyy" value="#{atenderChamado.filtrosAtender.dataInicial}" id="dtinicio" />
<h:outputLabel value="à"/>
<p:calendar locale="pt" pattern="dd/MM/yyyy" value="#{atenderChamado.filtrosAtender.dataFinal}" id="dtfinal" />
<h:outputLabel id="lstatus" value="Status:"/>
<p:selectOneMenu id="sOMStatus" value="#{atenderChamado.filtrosAtender.status}" height="100" required="true" >
<f:selectItem itemLabel="Todos Status" itemValue="T" />
<f:selectItem itemLabel="Pendente" itemValue="P" />
<f:selectItem itemLabel="Inicializado" itemValue="I" />
<f:selectItem itemLabel="Aguardando Retorno" itemValue="A" />
<f:selectItem itemLabel="Finalizado" itemValue="F" />
</p:selectOneMenu>
<h:outputLabel id="lstatusUsuario" value="Status Usuário:"/>
<p:selectOneMenu id="sOMStatusUsuario" value="#{atenderChamado.filtrosAtender.statusUsuario}" height="100" required="true" >
<f:selectItem itemLabel="Todos Status" itemValue="T" />
<f:selectItem itemLabel="Confirmado" itemValue="C" />
<f:selectItem itemLabel="Rejeitado" itemValue="R" />
</p:selectOneMenu>
<h:outputLabel id="lprioridade" value="Prioridade:"/>
<p:selectOneMenu id="sOMPrioridade" value="#{atenderChamado.filtrosAtender.prioridade}" height="100" required="true" >
<f:selectItem itemLabel="Todos" itemValue="-1" />
<f:selectItem itemLabel="Normal" itemValue="0" />
<f:selectItem itemLabel="Alta" itemValue="1" />
<f:selectItem itemLabel="Urgente" itemValue="2" />
</p:selectOneMenu>
<p:commandButton value="Atualizar" action="#{atenderChamado.AtualizarTabelas()}"
icon="ui-icon-search"
ajax="true"
onclick="chamados"/>
</h:panelGrid>
</p:panel>
<p:spacer height="20"/>
<p:panel header="Todos os Chamados" toggleable="true" toggleSpeed="500" closeSpeed="2000" widgetVar="panelTodos" collapsed="true">
<p:dataTable id="gtodos" var="tds" value="#{atenderChamado.camposTodos}"
paginator="true" rows="5"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15"
rowKey="#{tds.id}"
selection="#{tds}"
selectionMode="single"
emptyMessage="Nenhum Registro"
resizableColumns="true"
style="font-size: 9px;">
<p:column headerText="" style="width:2px" >
<p:commandButton action="#{atenderChamado.abrirFile(tds.id)}" onclick="chamados" icon="ui-icon-tag" title="Chamado com Anexo" rendered="#{tds.anexo}">
</p:commandButton>
</p:column>
<p:column headerText="Código" style="width:100px"
filterMatchMode="contains">
<h:outputText value="#{tds.id}" />
</p:column>
<p:column headerText="Categoria" style="width:100px">
<h:outputText value="#{tds.descricaoCategoria}" />
</p:column>
<p:column headerText="Grupo" style="width:100px" >
<h:outputText value="#{tds.descricaoGrupo}" />
</p:column>
<p:column headerText="Tipo Chamado" style="width:100px" >
<h:outputText value="#{tds.descricaoTipoChamado}" />
</p:column>
<p:column headerText="Módulo/Produto" style="width:100px" >
<h:outputText value="#{tds.descricaoModuloProduto}" />
</p:column>
<p:column headerText="Usuário" style="width:100px">
<h:outputText value="#{tds.nomeUsuario}" />
</p:column>
<p:column headerText="Status Usuário" style="width:100px" rendered="false">
<h:outputText value="#{tds.statusUsuario}" />
</p:column>
<p:column headerText="Data" style="width:100px">
<h:outputText value="#{tds.data}" >
<f:convertDateTime pattern="dd/MM/yyyy" />
</h:outputText>
</p:column>
<p:column headerText="Hora" style="width:100px" rendered="false">
<h:outputText value="#{tds.hora}" />
</p:column>
<p:column headerText="Prioridade" style="width:100px" >
<h:outputText value="#{tds.prioridade}" />
</p:column>
<p:column headerText="Assunto" style="width:100px" rendered="false">
<h:outputText value="#{tds.assunto}"/>
</p:column>
<p:column style="width:4%">
<p:commandButton id="selectButton" oncomplete="visuChamado.show()" icon="ui-icon-search" title="Visualizar Chamado" update=":fdiv:form:display"
actionListener="#{visualizarChamadoSuporte.visualizarChamado_new(tds.id)}">
<f:setPropertyActionListener value="#{tds}" id="fstplistener" target="#{atenderChamado.campoTodos}" />
</p:commandButton>
</p:column>
</p:dataTable>
</p:panel>
DIALOG QUE É CHAMADO PELO MEU DATATABLE
<p:dialog id="dialog_visu" header="Detalhes Chamado" widgetVar="visuChamado"
showEffect="explode" hideEffect="explode" dynamic="true">
<h:panelGrid id="display" columns="2" cellpadding="4">
<h:panelGroup id="ipanelGroup">
<h:form prependId="true">
<f:event type="javax.faces.event.PostAddToViewEvent"
listener="#{visualizarChamadoSuporte.processEvent}" />
</h:form>
</h:panelGroup>
</h:panelGrid>
</p:dialog>
Meu Bean
@ManagedBean
@SessionScoped
public class VisualizarChamadoSuporte implements ComponentSystemEventListener {
private ResultSet rs;
private ResultSet rs1;
private Integer IdChamado = 0;
private PreparedStatement ps1;
private String stempo = "";
private boolean show = false;
private List<UIComponent> children;
public boolean isShow() {
return show;
}
public void setShow(boolean show) {
this.show = show;
}
public Integer getIdChamado() {
return IdChamado;
}
public void setIdChamado(Integer IdChamado) {
this.IdChamado = IdChamado;
}
public void passarCodigo(Integer _idCodigo) {
IdChamado = _idCodigo;
}
@Override
public void processEvent(ComponentSystemEvent event) {
HtmlPanelGrid panel = new HtmlPanelGrid();
HtmlPanelGrid panelUm = new HtmlPanelGrid();
HtmlForm form = (HtmlForm) event.getComponent();
children = form.getChildren();
Funcoes func = new Funcoes();
try {
rs1 = Conexao.Consulta("select fn_help_total_horas_chamado as tempo from fn_help_total_horas_chamado(" + IdChamado.toString() + ")");
while (rs1.next()) {
if (!rs1.getString("tempo").equals("")) {
stempo = rs1.getString("tempo");
} else {
this.stempo = "00:00";
}
}
if (this.stempo.equals("")) {
this.stempo = "00:00";
}
} catch (SQLException ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro dinamico - Tempo", ex.getMessage()));
}
show = false;
try {
rs = Conexao.Consulta("select hac.id, gu.nome, cast(hac.data_hora as date) as data, cast(hac.data_hora as time) as hora, "
+ "case when hac.status = 'P' then 'Pendente' "
+ " when hac.status = 'C' then 'Cancelado' "
+ " when hac.status = 'A' then 'Aguardando Retorno' "
+ " when hac.status = 'F' then 'Finalizado' "
+ " when hac.status = 'I' then 'Inicializado' "
+ " when hac.status = 'R' then 'Rejeitado Usuário' "
+ "end as status, "
+ "hpc.assunto, hpc.problema, coalesce(hpc.solucao,'') as solucao, coalesce(hac.motivo_rejeicao,'') as motivo_rejeicao, "
+ "hac.avaliacao_usuario, hmp.descricao as modulo_produto, "
+ "case when coalesce(trim(gu.correio_eletronico),null) is null and coalesce(trim(super.correio_eletronico),null) is null then 'Sem e-mail' "
+ " when gu.correio_eletronico is not null then gu.correio_eletronico "
+ " when super.correio_eletronico is not null then super.correio_eletronico "
+ "end as correio_eletronico, "
+ "htc.descricao as tipo_chamado, "
+ "coalesce(gu1.nome,'') as suporte_atendeu_chamado "
+ "from help_abertura_chamado hac "
+ "join geral_usuarios gu on gu.cod_usuario = hac.id_usuario "
+ "join help_problema_chamados hpc on hpc.id_chamado = hac.id "
+ "join help_modulo_produtos hmp on hmp.id = hac.id_modulo_produtos "
+ "left join geral_usuarios super on super.cod_usuario = gu.supervisor "
+ "join help_tipos_chamados htc on htc.id = hac.id_tipo_chamados "
+ "left join help_suporte_chamados hsc on hsc.id_chamado = hac.id "
+ "left join geral_usuarios gu1 on gu1.cod_usuario = hsc.id_usuario "
+ "where hac.id = " + IdChamado.toString());
} catch (SQLException ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro ao carregar problema", ex.getMessage()));
}
try {
DateFormat fmt = new SimpleDateFormat("dd/MM/yyyy");
while (rs.next()) {
show = true;
panel.getChildren().add(func.CriaLabel("Chamado:", "lchamdo", true, false));
panel.getChildren().add(func.CriaLabel(rs.getString("id"), "chamado", false, false));
panel.getChildren().add(func.CriaLabel("Usuário:", "lusuario", true, false));
panel.getChildren().add(func.CriaLabel(rs.getString("nome"), "usuario", false, false));
panel.getChildren().add(func.CriaLabel("E-mail:", "lemail", true, false));
panel.getChildren().add(func.CriaLabel(rs.getString("correio_eletronico"), "email", false, false));
String dt = fmt.format(rs.getDate("data"));
panel.getChildren().add(func.CriaLabel("Data:", "ldata", true, false));
panel.getChildren().add(func.CriaLabel(dt, "data", false, false));
panel.getChildren().add(func.CriaLabel("Hora:", "lhora", true, false));
panel.getChildren().add(func.CriaLabel(rs.getString("hora"), "hora", false, false));
panel.getChildren().add(func.CriaLabel("Tipo Chamado:", "ltipoch", true, false));
panel.getChildren().add(func.CriaLabel(rs.getString("tipo_chamado"), "tipoch", false, false));
panel.getChildren().add(func.CriaLabel("Módulo/Produto:", "lmodulo_produto", true, false));
panel.getChildren().add(func.CriaLabel(rs.getString("modulo_produto"), "modulo_produto", false, false));
panel.getChildren().add(func.CriaLabel("Status:", "lstatus", true, false));
panel.getChildren().add(func.CriaLabel(rs.getString("status"), "status", false, false));
panel.getChildren().add(func.CriaLabel("Assunto:", "lassunto", true, false));
panel.getChildren().add(func.CriaLabel(rs.getString("assunto"), "assunto", false, false));
panel.getChildren().add(func.CriaLabel("Problema:", "lproblema", true, false));
panel.getChildren().add(func.CriaLabel(rs.getString("problema"), "problema", false, false));
panel.getChildren().add(func.CriaLabel("Tempo:", "ltempo", true, false));
panel.getChildren().add(func.CriaLabel(this.stempo, "tempo", false, false));
if (!rs.getString("solucao").equals("")) {
panel.getChildren().add(func.CriaLabel("Solução:", "lsolucao", true, true));
panel.getChildren().add(func.CriaLabel(rs.getString("solucao"), "solucao", false, false));
}
if (!rs.getString("motivo_rejeicao").equals("")) {
panel.getChildren().add(func.CriaLabel("Motivo Rejeição:", "lrejeicao", true, false));
panel.getChildren().add(func.CriaLabel(rs.getString("motivo_rejeicao"), "rejeicao", false, false));
}
if (!rs.getString("suporte_atendeu_chamado").equals("")) {
panel.getChildren().add(func.CriaLabel("Atendente:", "latendente", true, true));
panel.getChildren().add(func.CriaLabel(rs.getString("suporte_atendeu_chamado"), "atendente", false, false));
}
if (rs.getInt("avaliacao_usuario") > 0) {
panel.getChildren().add(func.CriaLabel("Avaliação:", "lavaliacao", true, false));
//panel.getChildren().add(func.CriaRating("avaliacao", rs.getInt("avaliacao_usuario"), true));
panel.getChildren().add(func.CriaOneRadio("iavaliacao", rs.getInt("avaliacao_usuario"), true));
}
}
} catch (SQLException ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro dinamico", ex.getMessage()));
}
try {
String sSQL = "select hcu.id, cast(hcu.data_hora as date) as data, cast(hcu.data_hora as time) as hora, hcu.data_hora, "
+ "cast(hcu.dthr_resposta as date) as data_resposta, cast(hcu.dthr_resposta as time) as hora_resposta, hcu.dthr_resposta, "
+ "hcu.pergunta, coalesce(ht.descricao,'') as terceiro, "
+ "case when hcu.resposta is null then 'Aguardando Resposta...' "
+ " when hcu.resposta is not null then hcu.resposta "
+ " when hcu.id_terceiro is not null then 'Informativo' end as resposta "
+ "from help_conversa_usuario hcu "
+ "left join help_terceiros ht on ht.id = hcu.id_terceiro "
+ "where hcu.id_chamado = " + IdChamado.toString()
+ " order by hcu.data_hora desc, hcu.dthr_resposta desc";
rs = Conexao.Consulta(sSQL);
} catch (SQLException ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro ao carregar problema - conversa", ex.getMessage()));
}
if (show) {
panel.setColumns(2);
children.add(panel);
children.add(func.CriaSeparador("sep_primeiro"));
panel = new HtmlPanelGrid();
panelUm = new HtmlPanelGrid();
panelUm.setColumns(3);
} else {
children = null;
}
Integer i = 0;
try {
DateFormat fmt = new SimpleDateFormat("dd/MM/yyyy");
while (rs.next()) {
String data = fmt.format(rs.getDate("data"));
String data_resposta = "";
if (rs.getDate("data_resposta") != null) {
data_resposta = fmt.format(rs.getDate("data_resposta"));
}
panelUm.getChildren().add(func.CriaImagem("imgs" + i.toString(), "suporte.png", "Recado Suporte - " + data));
if (!rs.getString("terceiro").equals("")) {
panelUm.getChildren().add(func.CriaLabel("Suporte - Terceiro: " + rs.getString("terceiro"), "lsup" + i.toString(), true, false));
} else {
panelUm.getChildren().add(func.CriaLabel("Suporte:", "lsup" + i.toString(), true, false));
}
if (rs.getDate("data_resposta") == null) {
panelUm.getChildren().add(func.CriaLabel(rs.getString("pergunta"), "perg" + i.toString(), false, false));
} else {
panelUm.getChildren().add(func.CriaLabel(rs.getString("pergunta"), "perg" + i.toString(), false, false));
}
if (rs.getString("terceiro").equals("")) {
if (rs.getDate("data_resposta") == null) {
panelUm.getChildren().add(func.CriaImagem("imgu" + i.toString(), "usuario.png", "Resposta Usuário - " + data_resposta));
panelUm.getChildren().add(func.CriaLabel("Usuário:", "lusu" + i.toString(), true, false));
} else {
panelUm.getChildren().add(func.CriaImagem("imgu" + i.toString(), "usuario.png", "Resposta Usuário"));
panelUm.getChildren().add(func.CriaLabel("Usuário:", "lusu" + i.toString(), true, false));
}
panelUm.getChildren().add(func.CriaLabel(rs.getString("resposta"), "resp" + i.toString(), false, false));
}
panel = new HtmlPanelGrid();
children.add(panelUm);
panelUm = new HtmlPanelGrid();
panelUm.getChildren().add(func.CriaEspaco("esp" + i.toString()));
children.add(panelUm);
panelUm = new HtmlPanelGrid();
children.add(func.CriaSeparador("sep" + i.toString()));
i = i + 1;
}
} catch (SQLException ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro dinamico - conversa", ex.getMessage()));
}
try {
String sSQL = "select ho.horas, htp.valor, ho.total, ho.descricao, "
+ "case when ho.confirmacao_usuario is null then 'Aguardando resposta' "
+ " when ho.confirmacao_usuario = false then 'Recusado' "
+ " when ho.confirmacao_usuario then 'Confirmado' end as confirmacao, "
+ "to_char(ho.total, 'L9999G999G999D99') as totaldescricao, "
+ "to_char(htp.valor, 'L9999G999G999D99') as valordescricao, "
+ "coalesce(ho.motivo_rejeicao,'') as motivo_rejeicao "
+ "from help_abertura_chamado hac "
+ "join help_orcamento ho on ho.id_chamado = hac.id "
+ "join help_tabela_preco htp on htp.id = ho.id_tabela_preco "
+ "where hac.id = " + IdChamado.toString()
+ "order by ho.dt_hr desc";
rs = Conexao.Consulta(sSQL);
} catch (SQLException ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro ao carregar orçamentos", ex.getMessage()));
}
/*
* panel.setColumns(2); children.add(panel);
* children.add(func.CriaSeparador("sep_primeiro2"));
*/
panelUm = new HtmlPanelGrid();
panelUm.setColumns(2);
i = 100;
try {
while (rs.next()) {
panelUm.getChildren().add(func.CriaImagem("imgo" + i.toString(), "orcamento_lista.png", "Orçamento Chamado"));
panelUm.getChildren().add(func.CriaLabel("", "l" + i.toString(), true, false));
panelUm.getChildren().add(func.CriaLabel("Descrição:", "ldesc" + i.toString(), true, false));
panelUm.getChildren().add(func.CriaLabel(rs.getString("descricao"), "desc" + i.toString(), false, false));
panelUm.getChildren().add(func.CriaLabel("Horas:", "lhora" + i.toString(), true, false));
panelUm.getChildren().add(func.CriaLabel(rs.getString("horas"), "horas" + i.toString(), false, false));
panelUm.getChildren().add(func.CriaLabel("Valor Hora:", "lvhora" + i.toString(), true, false));
panelUm.getChildren().add(func.CriaLabel(rs.getString("valordescricao"), "vhoras" + i.toString(), false, false));
panelUm.getChildren().add(func.CriaLabel("Total:", "ltotal" + i.toString(), true, false));
panelUm.getChildren().add(func.CriaLabel(rs.getString("totaldescricao"), "total" + i.toString(), false, false));
panelUm.getChildren().add(func.CriaLabel("Confirmação:", "lconfirmacao" + i.toString(), true, false));
panelUm.getChildren().add(func.CriaLabel(rs.getString("confirmacao"), "confirmacao" + i.toString(), false, false));
if (!rs.getString("motivo_rejeicao").equals("")) {
panelUm.getChildren().add(func.CriaLabel("Motivo Rejeição:", "lmotivo" + i.toString(), true, false));
panelUm.getChildren().add(func.CriaLabel(rs.getString("motivo_rejeicao"), "motivo" + i.toString(), false, false));
}
children.add(panelUm);
children.add(func.CriaSeparador("sep" + i.toString()));
i = i + 1;
}
} catch (SQLException ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro dinamico - orcamento", ex.getMessage()));
}
IdChamado = 0;
}
public String visualizarChamado(Integer _id) {
if (_id != 0) {
IdChamado = _id;
try {
ps1 = Conexao.Conecta().prepareStatement("update help_conversa_usuario set suporte_visualizou = true where id_chamado = ?");
ps1.setInt(1, _id);
ps1.executeUpdate();
} catch (Exception ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro update status o conversa", ex.getMessage()));
}
try {
ps1 = Conexao.Conecta().prepareStatement("update help_orcamento set visualizacao_suporte = true where id_chamado = ?");
ps1.setInt(1, _id);
ps1.executeUpdate();
} catch (Exception ex) {
Logger.getLogger(OrcamentoChamado.class.getName()).log(Level.SEVERE, null, ex);
}
return "visualizarChamadoSuporte";
} else {
return "chamados";
}
}
public String visualizarChamado_new(Integer _id) {
IdChamado = _id;
children = null;
return "chamados";
}
Explicando o meu Meu Bean, o metodo visualizarChamado_new é invocado pelo meu botao no datatable, onde seta null para o children que vai receber os componentes novos essa minha classe implementa um ComponentSystemEventListener, que eu posso fazer criação dinamica dos meus componentes.
Se eu executar isso de uma forma que eu chame por um botao externo, fora do meu datatable funciona, mas preciso que seja excutado em um dialog pra visualizaçao mais facil e melhor.
Obrigado pessoal!