掲示板

Arguments in liferay-ui:message

thumbnail
13年前 に Michael Wall によって更新されました。

Arguments in liferay-ui:message

Junior Member 投稿: 60 参加年月日: 10/07/22 最新の投稿
How do you use arguments with the liferay-ui:message tag?

I'm using 6.0 EE, have tried all variations, the parameter doesn't get applied, appears as {0} on screen.

Is therw any proper documentation for the liferay taglibs?
thumbnail
12年前 に Adrian Rodriguez Monedero によって更新されました。

RE: Arguments in liferay-ui:message

New Member 投稿: 15 参加年月日: 10/10/17 最新の投稿
The tag accepts an attribute named 'arguments' of type Object []. The following snippet works:

<liferay-ui:message key="message-key" arguments="<%=new String[]{\" test\"}%>"/&gt;</liferay-ui:message>


Anyhow, perhaps a "nicer" way to pass the arguments, even if it is only one argument, could be with
arguments='${fn:split("arg1,arg2 ",",")}'
thumbnail
10年前 に Dave Weitzel によって更新されました。

RE: Arguments in liferay-ui:message

Regular Member 投稿: 208 参加年月日: 09/11/18 最新の投稿
I was searching for how to pass multiple arguments and thought I would add this feedback as well

Michael Wall:
How do you use arguments with the liferay-ui:message tag?

I'm using 6.0 EE, have tried all variations, the parameter doesn't get applied, appears as {0} on screen.

if only passing one argument just pass the text string you want eg arguments="<%= myStringObject %>" or arguments="<%= dateFormat.format(anyDateObject) %>"

Michael Wall:

Is therw any proper documentation for the liferay taglibs?


Unfortunately not!
Taglib definitions are reasonable place to start or just read the code thy produce in init.jsp and page.jsp files