Guest User

Untitled

a guest
Nov 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. @Async
  2. public synchronized void carregarApresentacoesParaExportar() {
  3. try {
  4. ...............
  5. for(int i = 0 ; i < qtdePages; i++){
  6. if(isBaixado){
  7. percent = 0;
  8. qtdePages=0;
  9. break;
  10. } else {
  11. exportar.configurarValores(transacoes.getContent());
  12. if(transacoes.hasNext()){
  13. transacoes = getService(enumType).buscarPaginado(getFiltro(), new PageRequest(transacoes.nextPageable().getPageNumber(), MAX_EXPORTAR));
  14. }
  15. percent = ((i * 100) / qtdePages);
  16. }
  17. }
  18. ...............
  19. } catch (Exception e) {
  20. LOG.error(e, e);
  21. geraMsgErro("txt.erro.download.excel");
  22. FileUtils.deleteQuietly(arquivo);
  23. }
  24. }
  25.  
  26. <p:progressBar widgetVar="pbAjax" ajax="true" value="#{notificacaoMB.percent}" labelTemplate="{value}%"
  27. styleClass="animated" global="false">
  28. <p:ajax event="complete" listener="#{notificacaoMB.onComplete}" />
  29. </p:progressBar>
  30.  
  31. Outra ProgressBar
  32.  
  33. <div class="progress progress-striped active">
  34. <div style="width: #{notificacaoMB.percent}%" id="progress" aria-valuemax="100" aria-valuemin="0" aria-valuenow="#{notificacaoMB.percent}" role="progressbar" class="progress-bar progress-bar-success">
  35. <span >#{notificacaoMB.percent}%</span>
  36. </div>
  37. </div>
  38.  
  39. <h:commandButton title="#{messages['label.iniciar']}"
  40. value="#{messages['label.iniciar']}"
  41. actionListener="#{notificacaoMB.carregarApresentacoesParaExportar()}"
  42. onclick="PF('pbAjax').start();PF('startButton').disable();"
  43. widgetVar="startButton"
  44. rendered="#{notificacaoMB.possoIniciar()}"
  45. styleClass="btn btn-primary" />
Add Comment
Please, Sign In to add comment