• Post Reply Bookmark Topic Watch Topic
  • New Topic

message bundle with dynamic keys

 
Ergin Er
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • 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 ]
 
ya ji
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • 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?
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • 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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!