Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide back button at last tab in primefaces wizard

Tags:

primefaces

I would like to hide the BACK button at the last tab in a wizard. I'm using primefaces. What would be the solution for it?

Thank you

like image 608
Balint Szivos Avatar asked Jan 14 '13 16:01

Balint Szivos


1 Answers

you can do it client-side using jQuery :

Assuming you are using the wizard in the showcase: http://www.primefaces.org/showcase/ui/wizard.jsf:

<p:wizard widgetVar="wiz"  
        flowListener="#{userWizard.onFlowProcess}"
        onNext="hideBackOnLastTab()">

javascript:

function hideBackOnLastTab() {
    if($("ul.ui-wizard-step-titles>li").last()
             .is("ul.ui-wizard-step-titles>li.ui-state-highlight")) {
            $("div.ui-wizard-navbar>button.ui-wizard-nav-back").css("display", "none");
    }

}

Also you can notice that the next button in wizard is hidden (by the PF client-side) at last panel the same way.

like image 183
Mindwin Avatar answered Sep 19 '22 17:09

Mindwin