Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. <p:messages id="msgs" showDetail="false" autoUpdate="true"
  2. closable="true" />
  3. <p:wizard flowListener="#{caixaRecebimento_MB.onFlowProcess}" showNavBar="false" widgetVar="wRecebimento" styleClass="ms-botao" id = "wRecebimento" >
  4. <p:tab title="Documento" id="tabI">
  5. <ui:include src="/WEB-INF/templates/recebimento/RecebimentoDocumento.xhtml" />
  6. </p:tab>
  7. <p:tab title="Fechamento" id="tab1">
  8. <ui:include src="/WEB-INF/templates/recebimento/RecebimentoFechamento.xhtml" />
  9. </p:tab>
  10. <p:tab title="Ajuste Matricula" id="tab2">
  11.  
  12. </p:tab>
  13. <p:tab title="Assinatura" id="tabF">
  14.  
  15. </p:tab>
  16. </p:wizard>
  17.  
  18. <hr />
  19. <p:commandButton id="btVoltar" widgetVar="btVoltar" value="Voltar" onclick="PF('wRecebimento').back();" styleClass="ms-botao" icon="fa fa-arrow-left"
  20. disabled="#{caixaRecebimento_MB.dasabilitaVoltar}" update="btVoltar btAvancar"/>
  21. <p:commandButton id="btAvancar" widgetVar="btAvancar" value="Avançar" onclick="PF('wRecebimento').next();" styleClass="ms-botao" icon="fa fa-arrow-right" iconPos="rigth"
  22. disabled="#{caixaRecebimento_MB.desabilitaAvancar}" update="btVoltar btAvancar"/>
  23.  
  24. public String onFlowProcess(FlowEvent event) {
  25. if(event.getOldStep().equals("tabI")){
  26. if(loteDeVenda.getItensLoteDeVenda().size()<2){
  27. FacesUtil.addErrorMessage("Não é possivel avançar sem incluir um item");
  28. //return event.getOldStep();
  29. return " ";
  30. }
  31. }
  32.  
  33. if(event.getNewStep().equals("tabI")){
  34. this.desabilitaAvancar = false;
  35. this.dasabilitaVoltar = true;
  36. } else if(event.getNewStep().equals("tabF")){
  37. this.desabilitaAvancar = true;
  38. this.dasabilitaVoltar = false;
  39. } else {
  40. this.desabilitaAvancar = false;
  41. this.dasabilitaVoltar = false;
  42. }
  43.  
  44. return event.getNewStep();
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement