Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Michael Wall
Arguments in liferay-ui:message
December 14, 2010 2:56 AM
Answer

Michael Wall

Rank: Junior Member

Posts: 56

Join Date: July 22, 2010

Recent Posts

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?
Adrian Rodriguez Monedero
RE: Arguments in liferay-ui:message
May 13, 2011 10:06 AM
Answer

Adrian Rodriguez Monedero

Rank: New Member

Posts: 12

Join Date: October 17, 2010

Recent Posts

The tag accepts an attribute named 'arguments' of type Object []. The following snippet works:

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


Anyhow, perhaps a "nicer" way to pass the arguments, even if it is only one argument, could be with
1arguments='${fn:split("arg1,arg2 ",",")}'
Dave Weitzel
RE: Arguments in liferay-ui:message
June 19, 2013 3:50 PM
Answer

Dave Weitzel

Rank: Regular Member

Posts: 190

Join Date: November 18, 2009

Recent Posts

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