PrimeFaces向导禁用/启用自定义后退/下一步按钮?

时间:2015-12-01 19:12:52

标签: jsf jsf-2 primefaces

我在我的页面中使用PF5.3向导组件并使用自定义下一个/后退按钮我可以通过下面的代码禁用/启用这些按钮

<p:wizard style="border:0" showNavBar="false" widgetVar="terminationWizard" flowListener="#{equipTemplateBean.flowListener}"
                        onback="if (PF('terminationWizard').getStepIndex(PF('terminationWizard').currentStep) === 0) { PF('stepBackward').disable(); } PF('stepForward').enable();"
                        onnext="if (PF('terminationWizard').getStepIndex(PF('terminationWizard').currentStep) === 1) { PF('stepForward').disable(); } PF('stepBackward').enable();">

我的问题是如何隐藏/她在代码下面尝试了这些按钮

onback="if (PF('terminationWizard').getStepIndex(PF('terminationWizard').currentStep) === 0) { PF('stepBackward').hideBackNav(); } PF('stepForward').showBackNav();"
onnext="if (PF('terminationWizard').getStepIndex(PF('terminationWizard').currentStep) === 1) { PF('stepForward').hideNextNav(); } PF('stepBackward').showNextNav();"

但它不起作用。 如何使用showNextNav()hideNextNav()showBackNav()hideBackNav()方法来隐藏/她自定义按钮?

CommandButton代码

<p:commandButton widgetVar="stepBackward"   value="Back" icon="ui-icon-arrow-1-w" iconPos="right" onclick="PF('terminationWizard').back()" update="submitButton"/>
<p:commandButton value="Next" icon="ui-icon-arrow-1-e" iconPos="left"
onclick="PF('terminationWizard').next();" widgetVar="stepForward" update="submitButton"/>

0 个答案:

没有答案