我对Primefaces向导的后退/后退按钮标签有疑问。可以像以下示例一样自定义导航按钮标签:
最好的问候, 多路复用器
答案 0 :(得分:2)
是的,该组件具有nextLabel和backLabel两个属性。
https://primefaces.github.io/primefaces/7_0/#/components/wizard?id=attributes
nextLabel null String Label of next navigation button.
backLabel null String Label of back navigation button.
然后做..
<p:wizard widgetVar="wgtWizard" nextLabel="Next #{component.step}" backLabel="Back #{component.step}">
但是由于#component.step并非在每个步骤上都经过评估,因此您必须使用JQuery JS代码来执行此操作,如下所示:
var wizard = PF('wgtWizard');
var stepIndex = wizard.getStepIndex(wizard.currentStep);
wizard.nextNav.find('.ui-button-text').text('Next ' + stepIndex);
wizard.backNav.find('.ui-button-text').text('Back ' + (stepIndex-1));
只需在向导“ onback”和“ onnext” JS方法上执行该JS代码。