0
I have a list of Predio objects that is being iterated in my xthml Then, for each iteration, I create a panel and in each panel I display the name of each of the predicates in the list and a button that calls a method that loads the Procedio(Predio predio) in the Bean. This method only loads the bean’s predicate attribute with the received argument. After that, a dialog is opened and the information of the clicked predicate is displayed. The item names are being rendered perfectly on the screen. However, when the dialog opens, the fields see blank. Can anyone imagine what it is? Follows the code :
<c:forEach items="#{predioBean.listaPredios}" var="entry">
<h:panelGroup>
<h:outputText value="#{entry.nome}" />
<p:commandButton actionListener="#{predioBean.carregaPredio(entry)}" oncomplete="PF('DetalhesPredioDialog').show();"/>
</h:panelGroup>
</c:forEach>
<!-- ********** DIALOG DETALHES PREDIO ********** -->
<p:dialog header="#{predioBean.predio.nome}" widgetVar="DetalhesPredioDialog" modal="false" resizable="false" width="400" height="150" >
<h:panelGrid id="pnlDetalhesPredioDialog" style="margin-bottom:10px;" columns="2">
<h:outputLabel value="#{msg['nome']}" />
<p:inputText size="30" id="nomePredio" value ="#{predioBean.predio.nome}" />
<h:outputLabel value="#{msg['descricao']}" />
<p:inputText size="30" id="descricaoPredio" value ="#{predioBean.predio.descricao}"/>
<h:outputLabel value="#{msg['endereco']}" />
<p:inputText size="30" id="enderecoBanco" value ="#{predioBean.predio.endereco}" />
</h:panelGrid>
<h:panelGrid>
<p:commandButton value="#{msg['edita']}" icon="ui-icon-pencil" action="#{predioBean.editaPredio}"/>
</h:panelGrid>
</p:dialog>
Now the Bean:
@ManagedBean
@SessionScoped
public class PredioBean {
private Predio predio;
private List<Predio> listaPredios;
private PredioDAO predioDao;
@PostConstruct
public void initialize() {
this.predio = new Predio();
this.predioDao = new PredioDAO();
this.listaPredios = contaErrosDoPredio();
}
public void carregaPredio(Predio predio) {
this.predio = predio;
}
}
Thank you
Ever tried to update the dialog panelGrid by clicking the? update="pnlDetailsPredicDialog"
– Mario Hayasaki Júnior