在 Primefaces 向导的最后一个选项卡上隐藏后退按钮 [英] Hide back button at last tab in primefaces wizard

查看:56
本文介绍了在 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?

谢谢

推荐答案

您可以使用 jQuery 在客户端进行:

you can do it client-side using jQuery :

假设您在展示中使用向导:http://www.primefaces.org/showcase/ui/wizard.jsf:

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:

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");
    }

}

您还可以注意到向导中的下一个按钮在最后一个面板中隐藏(由 PF 客户端).

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

这篇关于在 Primefaces 向导的最后一个选项卡上隐藏后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆