Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <p:messages id="msgs" showDetail="false" autoUpdate="true"
- closable="true" />
- <p:wizard flowListener="#{caixaRecebimento_MB.onFlowProcess}" showNavBar="false" widgetVar="wRecebimento" styleClass="ms-botao" id = "wRecebimento" >
- <p:tab title="Documento" id="tabI">
- <ui:include src="/WEB-INF/templates/recebimento/RecebimentoDocumento.xhtml" />
- </p:tab>
- <p:tab title="Fechamento" id="tab1">
- <ui:include src="/WEB-INF/templates/recebimento/RecebimentoFechamento.xhtml" />
- </p:tab>
- <p:tab title="Ajuste Matricula" id="tab2">
- </p:tab>
- <p:tab title="Assinatura" id="tabF">
- </p:tab>
- </p:wizard>
- <hr />
- <p:commandButton id="btVoltar" widgetVar="btVoltar" value="Voltar" onclick="PF('wRecebimento').back();" styleClass="ms-botao" icon="fa fa-arrow-left"
- disabled="#{caixaRecebimento_MB.dasabilitaVoltar}" update="btVoltar btAvancar"/>
- <p:commandButton id="btAvancar" widgetVar="btAvancar" value="Avançar" onclick="PF('wRecebimento').next();" styleClass="ms-botao" icon="fa fa-arrow-right" iconPos="rigth"
- disabled="#{caixaRecebimento_MB.desabilitaAvancar}" update="btVoltar btAvancar"/>
- public String onFlowProcess(FlowEvent event) {
- if(event.getOldStep().equals("tabI")){
- if(loteDeVenda.getItensLoteDeVenda().size()<2){
- FacesUtil.addErrorMessage("Não é possivel avançar sem incluir um item");
- //return event.getOldStep();
- return " ";
- }
- }
- if(event.getNewStep().equals("tabI")){
- this.desabilitaAvancar = false;
- this.dasabilitaVoltar = true;
- } else if(event.getNewStep().equals("tabF")){
- this.desabilitaAvancar = true;
- this.dasabilitaVoltar = false;
- } else {
- this.desabilitaAvancar = false;
- this.dasabilitaVoltar = false;
- }
- return event.getNewStep();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement