tags:

views:

229

answers:

1

Hi,

Is it possible to write nested JSF expression? If yes, please give me the syntax. If No, Is there any possible work around ??

I need this as I need to display column in 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 cant hardcode 'key' in the expression lang. I need to read from properties file.

Please Help. Thanks.

+1  A: 

You should be able to write this without trying to nest an expression. This outputText displays a value in properties/bar.properties using a 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']]}" />

This could also be expressed as #{bar[foo.x]}.

McDowell