JSF Nested Expression Language

Can I write a nested JSF expression? If yes, please give me the syntax. If not, is there any possible work around?

I need this because I need to display a column in the rich Datatable from hasmap.

<rich:column> <f:facet name="header"> <h:outputText value="Item Number" /> </f:facet> <h:outputText value="#{item.get('key')}" /> </rich:column> 

In the above example, I cannot specify the "key" of the hard code in the lang expression. I need to read from the properties file.

Please, help. Thanks.

+4
source share
1 answer

You should be able to write this without trying to embed an expression. This outputText maps the value to properties/bar.properties , using the value in another properties file ( foo ) as the key:

 <f:loadBundle basename="properties.foo" var="foo" /> <f:loadBundle basename="properties.bar" var="bar" /> <h:outputText value="#{bar[foo['x']]}" /> 

It can also be expressed as #{bar[foo.x]} .

+4
source

All Articles