Galera,
Tenho o seguinte codigo
<p:dialog header="Detalhes do Comando" widgetVar="comandoDialog" resizable="false"
width="400" height="400" showEffect="slide" >
<h:panelGrid id="display" columns="2" cellpadding="4">
<h:outputText value="Nome:" />
<h:outputText value="#{comandoControle.comando.nome}" />
<h:outputText value="Comando:" />
<h:outputText value="#{comandoControle.comando.comando}" />
<h:outputText value="Descrição:" />
<h:outputText value="#{comandoControle.comando.descricao}" />
</h:panelGrid>
</p:dialog>
Desse jeito funciona beleza, sem problemas.]
mas quando eu faço isso:
<p:dialog header="Detalhes do Comando" widgetVar="comandoDialog" resizable="false"
width="400" height="400" showEffect="slide" >
<h:panelGrid id="display" columns="2" cellpadding="4">
<h:outputText value="Nome:" />
<h:inputText value="#{comandoControle.comando.nome}" />
<h:outputText value="Comando:" />
<h:inputText value="#{comandoControle.comando.comando}" />
<h:outputText value="Descrição:" />
<h:inputText value="#{comandoControle.comando.descricao}" />
</h:panelGrid>
</p:dialog>
não funciona de jeito nenhum.
Da o seguinte erro:
Caused by: javax.el.PropertyNotFoundException: /paginas/crud/comando.xhtml @62,76 value="#{comandoControle.comando.nome}": Target Unreachable, 'comando' returned null
Por que com o h:outputText funciona blza e ja com o h:inputText da essa zica.
Abaixo o meu codigo completo
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
template="./../../templates/template2.xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:f="http://java.sun.com/jsf/core">
<ui:define name="content">
<h:form prependId="false">
<h:outputLabel value="#{comandoControle.titulo}" style="font-size: 24px; font-weight: bold"/>
<p:spacer height="20" />
<p:ajaxStatus style="height:24px;display:block;">
<f:facet name="start">
<h:graphicImage value="./../../images/ajaxwait.gif" />
</f:facet>
<f:facet name="complete">
<h:outputText value="" />
</f:facet>
</p:ajaxStatus>
<p:spacer height="10" />
<p:dataTable var="comandos" value="#{comandoControle.listarComandos}" paginator="true" rows="10">
<p:column>
<f:facet name="header">
<h:outputText value="Nome" />
</f:facet>
<h:outputText value="#{comandos.nome}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Comando" />
</f:facet>
<h:outputText value="#{comandos.comando}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Descrição" />
</f:facet>
<h:outputText value="#{comandos.descricao}" />
</p:column>
<p:column style="width:32px">
<p:commandButton update="display" oncomplete="comandoDialog.show()"
image="ui-icon ui-icon-search">
<f:setPropertyActionListener value="#{comandos}"
target="#{comandoControle.comando}" />
</p:commandButton>
</p:column>
</p:dataTable>
<p:dialog header="Detalhes do Comando" widgetVar="comandoDialog" resizable="false"
width="400" height="400" showEffect="slide" >
<h:panelGrid id="display" columns="2" cellpadding="4">
<h:outputText value="Nome:" />
<h:inputText value="#{comandoControle.comando.nome}" />
<h:outputText value="Comando:" />
<h:inputText value="#{comandoControle.comando.comando}" />
<h:outputText value="Descrição:" />
<h:inputText value="#{comandoControle.comando.descricao}" />
</h:panelGrid>
</p:dialog>
</h:form>
</ui:define>
</ui:composition>
O meu bean esta como Session e esta Serializado tambem.