I am trying to display the result of a search using a search by ID method in my front end table using JSF but I am not getting it.
The method is working but I would like to know how to display this result in my table.
This is my code
<?xml version="1.0" encoding="ISO-8859-1" ?><ui:composition xmlns=“http://www.w3.org/1999/xhtml”
xmlns:h=“http://java.sun.com/jsf/html”
xmlns:p=“http://primefaces.org/ui”
xmlns:ui=“http://java.sun.com/jsf/facelets”
xmlns:f=“http://java.sun.com/jsf/core”
xmlns:pt=“http://xmlns.jcp.org/jsf/passthrough”
template="/template/template.xhtml">
<ui:define name="content">
<p:toolbar>
<f:facet name="left">
<h:outputText value="Serviços cadastrados" />
</f:facet>
</p:toolbar>
<h:form id="form1">
<h:panelGrid columns="4">
<h:outputLabel value="Descrição:" />
<h:inputText id="pesquisa" maxlength="50" size="30"
value="#{MBServiceEntity.entity.id}" />
<h:commandButton id="cbt" update="display"
actionListener="#{MBServiceEntity.searchById}"
image="/resources/img/pesquisar.png" title="Pesquisar">
</h:commandButton>
<p:button value="Novo" outcome="/pages/service.xhtml">
<f:param name="funcao" value="Novo" />
</p:button>
</h:panelGrid>
<p:dataTable id="tb_service"
emptyMessage="Nenhum Registro Cadastrado"
value="#{MBServiceEntity.toList}"
filteredValue="#{MBServiceEntity.itemFilter}" var="service" rows="6"
paginator="true" paginatorPosition="top">
<p:column headerText="N°OS" filterBy="#{service.id}"
sortBy="#{service.id}">
<h:outputText value="#{service.id}" />
</p:column>
<p:column headerText="Nome" filterBy="#{service.nome}"
sortBy="#{service.nome}">
<h:outputText value="#{service.nome}" />
</p:column>
<p:column headerText="CPF" filterBy="#{service.cpf}"
sortBy="#{service.cpf}">
<h:outputText value="#{service.cpf}" />
</p:column>
<p:column headerText="Opções">
<p:button icon="ui-icon-pencil" outcome="/pages/service.xhtml">
<f:param name="ParamServiceCodigo" value="#{service.id}" />
</p:button>
<p:button icon="ui-icon-trash" outcome="/pages/service.xhtml">
<f:param name="ParamServiceCodigo" value="#{service.id}" />
</p:button>
</p:column>
</p:dataTable>
</h:form>
</ui:define>
</ui:composition>