• 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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.
 
Looky! I'm being abducted by space aliens! Me and this tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic