This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript 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: 18662
71
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!