I have a problem updating the data of a SelectOneMenu in primefaces, as the code below suggests, I have a button that when clicked, brings data from a WebService and stores it in a Devices variable on the back end and shortly after , it only throws its names to the deviceNames list, this happens because the Size of the list with the names and OK, nothing happens in my SelectOneMenu. I have already made many changes but so far nothing. It seems to be pretty silly but I can not seem to find the problem.
XHTML Page
<h:body>
<p:messages autoUpdate="true"/>
<h:form id="mainform">
<p:commandButton id="button1"
value="Configuração">
<p:ajax listener="#{config.carregaSbcDevices}" update="panelAU"/>
</p:commandButton>
<p:outputPanel autoUpdate="true" id="panelAU">
<p:selectOneMenu value="#{config.configSCBEsc}">
<f:selectItem itemLabel="Selecione..." itemValue="" />
<f:selectItems value="#{config.devicesName}" />
</p:selectOneMenu>
</p:outputPanel>
</h:form>
</h:body>
Bean config
public void carregaSbcDevices() {
if(this.devices == null) this.devices = new ArrayList<>();
this.devices.clear();
if(this.devicesName == null) this.devicesName = new ArrayList<>();
this.devicesName.clear();
session.getDevices(this.devices);
for(SBCDevices device : this.devices) {
this.devicesName.add(device.getTargetName());
}
System.out.println("Numero: " + this.devicesName.size());
}