E ai gente. Estou tendo problemas com meu dialog… Ele abre, mas nao aparece as informações dos campos…
Não sei por que, esta igual ao exemplo do single row select do prime [[color=blue]http://www.primefaces.org/showcase/ui/datatableRowSelectionByColumn.jsf[/color]]
alguma ideia?
WEB:
<h:form id="frmCmhAberto">
<p:dataTable var="varChamado" value="#{chamadoBean.chamadoList}" rowStyleClass="#{empty rowIx or rowIx mod 2 ne 0 ? 'linha2' : 'linha1'}" rowIndexVar="rowIx" style="width: 700px">
<f:facet name="header">CHAMADOS EM ABERTO</f:facet>
<p:column>
<f:facet name="header">
<h:outputText value="ID" />
</f:facet>
<h:outputText value="#{varChamado.id}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="NÚMERO" />
</f:facet>
<h:outputText value="#{varChamado.numero}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="IDENTIFICAÇÃO" />
</f:facet>
<h:outputText value="#{varChamado.identificacao}" />
</p:column>
<p:column style="width: 50px">
<f:facet name="header">
<h:outputText value="ABRIR" />
</f:facet>
<p:commandButton update=":frmCmhAberto:formCmh" oncomplete="dlgChamado.show()" icon="ui-icon-search" title="Abrir">
<f:setPropertyActionListener value="#{verChamado}" target="#{chamadoBean.chamadoSelecionado}" />
</p:commandButton>
</p:column>
</p:dataTable>
<p:dialog header="CHMADO" widgetVar="dlgChamado" resizable="false" draggable="false" style="width: 100px">
<h:panelGrid columns="2" id="formCmh">
<h:outputText value="ID: "/>
<h:outputText value="#{chamadoBean.chamadoSelecionado.id}"/>
<h:outputText value="NÚMERO: "/>
<h:outputText value="#{chamadoBean.chamadoSelecionado.numero}"/>
<h:outputText value="IDENTIFICAÇÃO: "/>
<h:outputText value="#{chamadoBean.chamadoSelecionado.identificacao}"/>
</h:panelGrid>
</p:dialog>
</h:form>
Bean:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package bean;
import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
/**
*
* @author pedro.fechener
*/
@ManagedBean
public class ChamadoBean {
private List<Chamado> chamadoList;
private Chamado chamadoSelecionado;
public ChamadoBean() {
chamadoList = new ArrayList<Chamado>();
chamadoList.add(new Chamado(1L, "Chamado 1", "1º TESTE"));
chamadoList.add(new Chamado(2L, "Chamado 2", "teste 2"));
chamadoList.add(new Chamado(3L, "Chamado 3", "outro teste"));
}
public List<Chamado> getChamadoList() {
return chamadoList;
}
public void setChamadoList(List<Chamado> chamadoList) {
this.chamadoList = chamadoList;
}
public Chamado getChamadoSelecionado() {
return chamadoSelecionado;
}
}
Chamado
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package bean;
/**
*
* @author pedro.fechener
*/
public class Chamado {
private long id;
private String numero;
private String identificacao;
public Chamado(long id, String numero, String identificacao) {
this.id = id;
this.numero = numero;
this.identificacao = identificacao;
}
/**
* @return the id
*/
public long getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(long id) {
this.id = id;
}
/**
* @return the numero
*/
public String getNumero() {
return numero;
}
/**
* @param numero the numero to set
*/
public void setNumero(String numero) {
this.numero = numero;
}
/**
* @return the identificacao
*/
public String getIdentificacao() {
return identificacao;
}
/**
* @param identificacao the identificacao to set
*/
public void setIdentificacao(String identificacao) {
this.identificacao = identificacao;
}
}
Tela:
https://plus.google.com/u/0/photos/107785778487463664105/albums/5699657508887862465
