• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
They weren't very bright, but they were very, very big. Ad contrast:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic