Open volosied opened 1 year ago
Agreed. There are indeed real world use cases where this is really useful. The technical problem is that FaceletContext
is essentially volatile and is tied to the current Facelet being being processed. The implementation in Mojarra is actually not entirely correct (ui:param
is leaking outside Facelet). Ultimately we would need a helper something like FaceletContext.getIncludeParam(faceletPath, paramName)
.
There is another difficulty. A single include file can be included multiple times in same view. How do we know which one we want to obtain the param from? By index will do it but is pretty brittle when dev decides to rearrange layout and forgets to adjust index to obtain param.
We could give <ui:include>
/<ui:decorate>
something like an id
attribute but it should not be confused with those of UIComponent
.
Mojarra supports the following:
However, the code above does not always work in MyFaces. One workaround is to use c:set instead, but it would nice to have something spec defined.
Additional Information:
Passing bean properties and action methods via <ui:param>
section