I would like my p: selectOneMenu to reload the items and show the options every time I clicked to open the dropdown, has anyone tried to do this? If so, how do I do it?
I would like my p: selectOneMenu to reload the items and show the options every time I clicked to open the dropdown, has anyone tried to do this? If so, how do I do it?
You can change the get of the list in the bean:
public List<Bla> getListaBla() {
updateBlaList();
return this.blaList;
}
You can fire an ajax request that updates the list.
<p:selectOneMenu value="#{bean.object.property}" id="myId" required="true">
<f:selectItems value="#{bean.list}" />
<f:ajax event="click" listener="#{bean.updateList}" />
</p:selectOneMenu>
Not the ideal way to do it .. the best way would be to reload the page already bring all the items.
What if you include a poll? From time to time you update your select ...
<p:poll interval="3" listener="#{counterView.increment}" update="txt_count" />