Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <h:body>
  2. <p:messages autoUpdate="true"/>
  3. <h:form id="mainform">
  4. <p:commandButton id="button1"
  5. value="Configuração">
  6. <p:ajax listener="#{config.carregaSbcDevices}" update="panelAU"/>
  7. </p:commandButton>
  8. <p:outputPanel autoUpdate="true" id="panelAU">
  9. <p:selectOneMenu value="#{config.configSCBEsc}">
  10. <f:selectItem itemLabel="Selecione..." itemValue="" />
  11. <f:selectItems value="#{config.devicesName}" />
  12. </p:selectOneMenu>
  13. </p:outputPanel>
  14. </h:form>
  15. </h:body>
  16.  
  17. public void carregaSbcDevices() {
  18. if(this.devices == null) this.devices = new ArrayList<>();
  19. this.devices.clear();
  20.  
  21. if(this.devicesName == null) this.devicesName = new ArrayList<>();
  22. this.devicesName.clear();
  23.  
  24. session.getDevices(this.devices);
  25. for(SBCDevices device : this.devices) {
  26. this.devicesName.add(device.getTargetName());
  27. }
  28.  
  29. System.out.println("Numero: " + this.devicesName.size());
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement