4

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 Answer 1

4

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]}.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.