How to load the list of items from p: selectOneMenu when clicking to open the dropdown?

1

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?

    
asked by anonymous 07.07.2014 / 20:43

3 answers

1

You can change the get of the list in the bean:

public List<Bla> getListaBla() {
    updateBlaList();
    return this.blaList;
}
    
14.07.2014 / 18:33
0

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.

    
08.07.2014 / 03:26
0

What if you include a poll? From time to time you update your select ...

<p:poll interval="3" listener="#{counterView.increment}" update="txt_count" />
    
11.07.2014 / 15:07