0
如何在tag屬性內添加outputFormat?如何在output屬性中添加outputFormat參數化消息屬性
例
...
<p:column headerText="#{msgs.actions}">
<p:commandButton id="btnDelEspai" icon="fa fa-trash Fs16 White"
styleClass="Fright RedButton" iconPos="right"
action="#{espaisBean.deleteEspai()}"
title="#{msgs.esp_delete}"
update="frmEspais:tblEspais frmEspais:error_panel">
<p:confirm header="#{msgs.delconfirmation}"
message="ADD CODE HERE" icon="ui-icon-alert">
</p:confirm>
<f:setPropertyActionListener value="#{e}"
target="#{espaisBean.selEspai}" />
</p:commandButton>
</p:column>
...
代碼添加
<h:outputFormat value="#{msgs.esp_delconfirmation_id}" >
<f:param value="#{e.id}"/>
</h:outputFormat>
'#{of:format1('one {0}','two')}'http://showcase.omnifaces.org/functions/Strings –
jsf或primefaces的任何其他選項? – Joe
向bean中添加一個格式化方法,並在那裏進行格式化。另見https://github.com/omnifaces/omnifaces/blob/2.6/src/main/java/org/omnifaces/el/functions/Strings.java#L255 –