[jboss-user] [JBoss Seam] - Re: Seam selectItems ignores label tag
hubaer
do-not-reply at jboss.com
Wed Jan 17 06:06:40 EST 2007
I tried your suggestion, but it seems that #{messages['languagename.'language.isocode]} not works. I always get an exception:
Caused by: javax.el.ELException: Error Parsing: #{messages['languagename.'language.isocode]}
| at com.sun.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:140)
| at com.sun.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:157)
| at com.sun.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:201)
| at com.sun.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:74)
| at com.sun.facelets.tag.TagAttribute.getValueExpression(TagAttribute.java:256)
| ... 84 more
| Caused by: com.sun.el.parser.Pars
| 11:30:11,219 ERROR [STDERR] eException: Encountered "language" at line 1, column 27.
| Was expecting one of:
| "." ...
| "[" ...
| "]" ...
| ">" ...
| "gt" ...
| "<" ...
| "lt" ...
| ">=" ...
| "ge" ...
| "<=" ...
| "le" ...
| "==" ...
| "eq" ...
| "!=" ...
| "ne" ...
| "&&" ...
| "and" ...
| "||" ...
| "or" ...
| "*" ...
| "+" ...
| "-" ...
| "?" ...
| "/" ...
| "div" ...
| "%" ...
| "mod" ...
|
| at com.sun.el.parser.ELParser.generateParseException(ELParser.java:1651)
So I seached the internet an found out that EL cannot concat strings this way.
I found a solution, but I find is not very beautiful, but it works.
I defined the jstl functions in my header
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
and could now use the replace function (a concat is not available) like followed:
<h:selectOneMenu value="#{user.language}">
| <si:selectItems
| value="#{languages}" var="language" label="#{messages[fn:replace('languagename.SUFFIX', 'SUFFIX', language.isocode)]}"/>
| </h:selectOneMenu>
Maybe I'll try to write my own concat-functions.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4002704#4002704
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4002704
More information about the jboss-user
mailing list