我的数据表没有显示排除消息。我将消息的 ID 放在数据表内命令按钮的更新方法上,但我收到 Cannot find component with identifier "messages" referenced from "j_idt31:
自动完成功能不起作用。错误发生在转换器的名称中。我把名字以大写和小写开头,但不起作用。我收到
Jul 29, 2013 4:11:19 PM com.sun.faces.application.ApplicationImpl createConverter
SEVERE: JSF1006: Não pode criar instância para o conversor de tipo pacienteConverter
<ui:define name="conteudo">
<h:form>
<p:panelGrid columns="2" id="painel"
style="width: 100%; margin-top: 20px" columnClasses="rotulo, campo">
<p:outputLabel value="Nome do paciente" for="nPaciente" />
<p:autoComplete value="#{cadastroPacienteBean.pacienteSelecionado}" id="nPaciente"
completeMethod="#{cadastroPacienteBean.pacientes}" var="p"
itemLabel="#{p.name}" itemValue="#{p}" converter="pacienteConverter"
forceSelection="true">
<f:facet name="itemtip">
<h:panelGrid columns="2" cellpadding="5">
<h:outputText value="Nome do Paciente: " />
<h:outputText value="#{p.nomePaciente}" />
</h:panelGrid>
</f:facet>
</p:autoComplete>
</p:panelGrid>
<p:messages id="messages" showDetail="false" showSummary="true" />
<p:dataTable id="dataTable" var="paciente"
value="#{consultaPacienteBean.pacientes}" paginator="true" rows="10"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15">
<p:column sortBy="#{paciente.nomePaciente}"
headerText="nome do Paciente">
<h:outputText value="#{paciente.nomePaciente}" />
</p:column>
<p:column style="width: 100px; text-align: center">
<p:button icon="ui-icon-pencil" outcome="CadastroPaciente"
title="Editar">
<f:param name="codigo" value="#{paciente.codigo}" />
</p:button>
<p:commandButton action="#{consultaPacienteBean.excluir}"
icon="ui-icon-trash" title="Excluir" update="dataTable,messages"
ajax="true">
<f:setPropertyActionListener
target="#{consultaPacienteBean.pacienteSelecionado}"
value="#{paciente}" />
</p:commandButton>
</p:column>
</p:dataTable>
</h:form>
</ui:define>
我的班级转换器:
@FacesConverter(forClass=Paciente.class)
public class PacienteConverter implements Converter {
}