I'm new to JSF, I'd like a tip, how can I populate a datatable through a selection of a combobox that brings a list of items from the database.
I'm new to JSF, I'd like a tip, how can I populate a datatable through a selection of a combobox that brings a list of items from the database.
If you are using JSF 2.0 or higher, you can use the 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>