Primefaces向导 - 如何禁用next / prev按钮动画?

时间:2022-08-23 22:40:06

I have PrimeFaces wizard with some panels, and next/prev buttons is drawn by wizard widget itself... But there is one problem - when i press next button before the last step, it hides with animation... Is it possible to disable this animation and hide next button instantly?

我有一些面板的PrimeFaces向导,而下一个/ prev按钮是由向导小部件本身绘制的......但是有一个问题 - 当我在最后一步之前按下一个按钮时,它隐藏了动画...是否可以禁用这个动画并立即隐藏下一个按钮?

1 个解决方案

#1


So, you simply want to remove the fading effects on the wizard next button ?

那么,你只是想删除向导下一个按钮的淡化效果?

These effects are done with Primefaces Javascript built-in functions, like:

使用Primefaces Javascript内置函数完成这些效果,例如:

PrimeFaces.widget.Wizard.prototype.showNextNav = function() {
    jQuery(this.nextNav).fadeIn();
}
PrimeFaces.widget.Wizard.prototype.hideNextNav = function() {
    jQuery(this.nextNav).fadeOut();
}

However, Primefaces creators have let the possibility of overriding them quite easily. Just add this in your .xhtml page:

然而,Primefaces创作者已经很容易地覆盖它们。只需在.xhtml页面中添加:

 <script>
 PrimeFaces.widget.Wizard.prototype.hideNextNav = function() {
        jQuery(this.nextNav).hide();
    }
 PrimeFaces.widget.Wizard.prototype.showNextNav = function() {
        jQuery(this.nextNav).show();
    }
 </script>

Tested and working on PF 5.1.

测试并使用PF 5.1。

#1


So, you simply want to remove the fading effects on the wizard next button ?

那么,你只是想删除向导下一个按钮的淡化效果?

These effects are done with Primefaces Javascript built-in functions, like:

使用Primefaces Javascript内置函数完成这些效果,例如:

PrimeFaces.widget.Wizard.prototype.showNextNav = function() {
    jQuery(this.nextNav).fadeIn();
}
PrimeFaces.widget.Wizard.prototype.hideNextNav = function() {
    jQuery(this.nextNav).fadeOut();
}

However, Primefaces creators have let the possibility of overriding them quite easily. Just add this in your .xhtml page:

然而,Primefaces创作者已经很容易地覆盖它们。只需在.xhtml页面中添加:

 <script>
 PrimeFaces.widget.Wizard.prototype.hideNextNav = function() {
        jQuery(this.nextNav).hide();
    }
 PrimeFaces.widget.Wizard.prototype.showNextNav = function() {
        jQuery(this.nextNav).show();
    }
 </script>

Tested and working on PF 5.1.

测试并使用PF 5.1。