我试图在这篇文章中实现BalusC的答案,但当我尝试使所需的条件取决于向导外部的按钮时,它无法正常工作,我用来控制"后退"和"下一步"向导 怎么能实现这个?
<h:form id="form" enctype="multipart/form-data" acceptcharset="ISO-8859-1" >
<p:growl id="growl" sticky="true" showDetail="true"/>
<p:wizard id="wizard" flowListener="#{myBean.onFlowProcess}" showNavBar="false" widgetVar="wizardWV">
<p:tab id="tab1" title="Tab 1" >
<p:panel header="Panel for tab 1">
<p:message for="year" />
<br />
<table>
<tr>
<td>
<h:outputLabel value="Year: " />
</td>
<td>
<p:inputMask
id="year"
value="#{myBean.year}"
required="#{not empty param[nextPanel.clientId]}"
requiredMessage="Year is required!"
style="width:70px;"
mask="9999"
maxlength="4"
/>
</td>
</tr>
</table>
</p:panel>
</p:tab>
<p:tab id="tab2" title="Tab 2" >
<p:panel header="Panel for tab 2">
</p:panel>
</p:tab>
</p:wizard>
<p:commandButton id="backPanel" value="Back" onclick="PF('wizardWV').back();" styleClass="internalButton" …Run Code Online (Sandbox Code Playgroud) 我正在尝试实现一个高级selectOneMenu(PrimeFaces) 以根据其标志图标选择语言环境。图标显示在列表中,但不显示所选项目(展示同样发生)。我怎么能这样做?
<p:selectOneMenu id="mySOMId" value="#{localeBean.locale}" var="mySOMVar" converter="#{localeConverter}" >
<f:selectItems
value="#{myBean.locales}"
var="localeSIVar"
itemLabel="#{localeSIVar.language}"
itemValue="#{localeSIVar}" />
<p:column style="text-align: center;" >
<h:graphicImage library="default" height="20" name="img/#{mySOMVar.language}.svg" />
</p:column>
</p:selectOneMenu>
Run Code Online (Sandbox Code Playgroud)
我可以看到它f:selectItems有一个itemLabelEscaped属性,我可以用它在 中输出<img>标签itemLabel,但我不知道我会在它的src.
谢谢