6

I am referring to pretty deep object hierarchies with pretty cryptic names in EL as in #{myBean.configBaseStack.excludeMethodFromAccounting.method.TimeoutBehaviorEnabled}.

I would like to point to this very same property through an alias like in:

<x:alias name="m" value="#{myBean.configBaseStack.excludeMethodFromAccounting.method" />
<h:inputText value="#{m.TimeoutBehaviorEnabled}" />

I guess one way to accomplish this would be to create these aliases in the backing bean, but I'd rather leave that to the template.

How to accomplish this in template/facelet level?

Tuukka Mustonen
  • 4,722
  • 9
  • 49
  • 79

3 Answers3

9

I think you can use <ui:param> to accomplish this:

<ui:param name="m" value="#{myBean.configBaseStack.excludeMethodFromAccounting.method}"/>

Then you can use it like this on the same page:

<h:inputText value="#{m.TimeoutBehaviorEnabled}" />
Shervin Asgari
  • 23,901
  • 30
  • 103
  • 143
1

You could probably use the JSTL-equivalent set tag for this (using the var and value attributes).

McDowell
  • 107,573
  • 31
  • 204
  • 267
  • That would be possible, but it would lock the relation. Using `ui:param` as Shervin suggests allows using properties more flexibly. Good suggestion, though. – Tuukka Mustonen Jan 03 '11 at 16:09
0

For all i know aliasing is not not supported in jsf, using the standard components that is.

Lefteris Laskaridis
  • 2,292
  • 2
  • 24
  • 38