Skip to content

Instantly share code, notes, and snippets.

@nosrednawall
Last active June 18, 2018 12:39
Show Gist options
  • Select an option

  • Save nosrednawall/1cd6026e282e3b15dd8bbfd69355b439 to your computer and use it in GitHub Desktop.

Select an option

Save nosrednawall/1cd6026e282e3b15dd8bbfd69355b439 to your computer and use it in GitHub Desktop.
Atualizar campos com primefaces
<h:form>
<!-- aqui fica a declaração da tabela -->
<p:dataTable id="tabela" value="#{meuBean.pessoas}"
var="pessoa"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {Exporters}"
paginator="true" rows="10" style="margin-bottom:20px"
rowStyleClass="#{pessoa.status == 'INATIVO' ? 'inativo-row' : null}"
liveResize="true" emptyMessage="Nenhum Registro Encontrado">
<!-- aqui fica o select com os status da tebela -->
<f:facet name="header">
<p:outputPanel>
<h:outputText value="Opções de listagem" />
<p:selectOneMenu value="#{meuBean.meusStatus}"
style="width:150px" immediate="true" autoWidth="true">
<f:selectItems value="#{meuBean.meusStatus}" />
<p:ajax execute="#{meuBean.init()}" update="@form" />
</p:selectOneMenu>
</p:outputPanel>
</f:facet>
<!-- aqui fica a tabela -->
</p:datatable>
</h:form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment