Estou com um problema ao tentar dar update em um componente.
XHTML:
<?xml version="1.0" encoding="ISO-8859-1" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"xmlns:h="http://java.sun.com/jsf/html"xmlns:f="http://java.sun.com/jsf/core"xmlns:p="http://primefaces.org/ui"><p:fieldsetlegend="Cadastro de categorias"><h:outputTextvalue="Descrição: "/><h:inputTextvalue="#{beanCategoria.categoria.descricao}"id="desc"/><p:commandButtonvalue="Salvar"action="#{beanCategoria.adicionar}"update="listaCategorias"/></p:fieldset><br/><p:fieldsetlegend="Categorias cadastradas"><p:dataTablevar="cat"value="#{beanCategoria.categorias}"id="listaCategorias"rowKey="#{cat.id}"selectionMode="single"selection="#{beanCategoria.categoria}"filteredValue="#{tableBean.filteredCategorias}"><p:ajaxevent="rowSelect"update="desc"/><f:facetname="header">
Lista de Categorias
</f:facet><p:columnheaderText="Cód."id="id"sortBy="#{cat.id}"filterBy="#{cat.id}"><h:outputTextvalue="#{cat.id}"/></p:column><p:columnheaderText="Descrição"id="descricao"sortBy="#{cat.descricao}"filterBy="#{cat.descricao}"><h:outputTextvalue="#{cat.descricao}"/></p:column></p:dataTable></p:fieldset></html>
Erro:
Ago 26, 2012 8:34:12 PM com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback visit
Grave: javax.faces.FacesException: Cannot find component with identifier "desc" referenced from "listaCategorias".
Então estou dizendo que quero dar o update no componente com id "desc", porém ele interpreta como "listaCategorias:desc", alguém sabe como eu "digo" que é o "desc" que eu quero, não o "listaCategorias:desc"?
Tentei mas sem sucesso.
Alguém tem mais alguma ideia?
J
jeffev
Fiz umas alterações no meu código, porém continuo com o mesmo problema.
XHTML:
<?xml version="1.0" encoding="ISO-8859-1" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"xmlns:h="http://java.sun.com/jsf/html"xmlns:f="http://java.sun.com/jsf/core"xmlns:p="http://primefaces.org/ui"><p:fieldsetlegend="Categorias cadastradas"><h:formprependId="false"><p:commandButtonactionListener="#{beanCategoria.prepararNovo}"value="Nova categoria!"oncomplete="dialogCadCat.show()"update=":infosCat"/><p:dataTablevar="cat"value="#{beanCategoria.listarCategorias}"id="listaCategorias"rowKey="#{cat.id}"filteredValue="#{tableBean.filteredCategorias}"><f:facetname="header">
Lista de Categorias
</f:facet><p:columnheaderText="Cód."id="id"sortBy="#{cat.id}"filterBy="#{cat.id}"><h:outputTextvalue="#{cat.id}"/></p:column><p:columnheaderText="Descrição"id="descricao"sortBy="#{cat.descricao}"filterBy="#{cat.descricao}"><h:outputTextvalue="#{cat.descricao}"/></p:column><p:column><f:facetname="header"><h:outputTextvalue="Alterar"/></f:facet><p:commandButtonactionListener="#{beanCategoria.prepararAlterar}"value="Alterar"oncomplete="dialogCadCat.show()"/></p:column><p:column><f:facetname="header"><h:outputTextvalue="Excluir"/></f:facet><p:commandButtonaction="#{beanCategoria.excluir}"value="Excluir"/></p:column></p:dataTable></h:form></p:fieldset><p:dialogheader="Cadastro de Categorias"widgetVar="dialogCadCat"resizable="false"modal="true"showEffect="fade"hideEffect="fade"><h:formprependId="false"><h:panelGridid="infosCat"columns="2"style="margin-bottom:10px"><h:outputLabelfor="id"value="Cód.:"/><h:outputLabelid="id"value="#{beanCategoria.categoria.id}"/><h:outputLabelfor="descricao"value="Descrição:"/><h:inputTextid="descricao"value="#{beanCategoria.categoria.descricao}"/><p:commandButtononcomplete="dialogCadCat.hide();"actionListener="#{beanCategoria.adicionar}"value="Inserir Livro"/><p:commandButtononcomplete="dialogCadCat.hide();"actionListener="#{beanCategoria.alterar}"value="Alterar Livro"/></h:panelGrid></h:form></p:dialog></html>