Popular datatable jsf

Asked

Viewed 41 times

0

Personal am beginner in JSF, would like a tip, as I can popular a datatable through a selection of a combobox that brings a list of items from the bank.

  • You are using JSF or Primefaces?

1 answer

0

If you are using JSF 2.0 or higher, you can use the component f:ajax

<h:selectOneMenu value="#{bean.itemSelecionado}">
    <f:selectItems value="#{bean.itens}" var="item" itemLabel="#{item.nome}" itemValue="#{item.id}"/>
    <f:ajax listener="#{bean.listarDataTable}" render="idDoDataTable"/>
</h:selectOneMenu>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.