Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Nested EL in h:outputFormat  RSS feed

 
ed connell
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Out to prove once again a greenhorn I be, so here goes (keep it friendly all)

Appears to me what I want is a nested value in EL for the h:formatText

Of course, I could do this with a bean property, but was just trying to avoid it.

Here's the situation. Simple enough. One page has basically the same output simple toggled by an input param, either "daily" or "montly"

So, assume I want the title to say "Daily Statistics" or "Monthly Statistics". My resource bundles would be:

ingles:
stat_pg_title={0} Statistics

espanol:
stat_pg_title={0} estadísticas

Can I get "Daily" or "Monthly" to get its locale equivalent into {0}? I've tried different combinations of things, to no avail. One attempt was to store "Daily" or "Monthly" in a bean property "timePeriod" as so...


Any ideas?

Thanks.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One "#" is hint enough.

I think what you're looking for is "#{msg.userStats[timePeriod]}". I'm not sure why you'd want a half-and-half solution, though. It would be simpler to put the whole caption in a bundle with (with locales, in your case).

So instead of "{0} Statistics", "Daily Statistics" and "Monthy Statistics" in the bundle, selecting as appropriate.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!