Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

message bundle with dynamic keys

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to use message bundle with key values gathered from an object?
Standard message-bundles work this way:



I would like to get the #{bundleContent.label3} part used in a dynamic way. the .labelx part needs to correspond with the eventObject.label. Something like this:
value="#{bundleContent.#{eventObject.label}}". Of course this doesn't work, so I'm looking for a solution on this. Ik can manipulate the eventObject before it's passed on to the jsf page, but that seems to me as a very dirty solution.
In short:
I need a jsf component that works like the following struts component:

[ October 19, 2006: Message edited by: Ergin Er ]
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using JSF.

Using #{messages[item.Label]} works fine, but what I need is the key is combined with constant+variable.

Any solution?
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wrap it by a managed bean function or an EL function or make use of JSTL's c:set.

That said, in the future you should not resurrect zombie topics and for sure not hijack other's topics for own convenience. Kindly start a new one for each independent problem.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic