The aliasBean tag allows you to link a fictive bean to a real bean.
Let's suppose you have a subform you use often but with different beans.
The aliasBean allows you to design the subform with a fictive bean and to include it in all the pages where you use it.
You just need to make an alias to the real bean named after the fictive bean before invoking the fictive bean.
example :
In this example, the customerAddress bean is a managed bean, but the address bean isn't defined anywhere.
After the aliasBean tag, we can use #{address.*} in place of #{custommerAddress.*}, so making it possible to have a generic address subforms (ok, this one it a bite simple form, but here is the idea).
<h:form>
<x:aliasBean sourceBean="#{customerAddress}" alias="#{address}"/>
<f:subview id="simulatedIncludedSubform">
<%-- The next tag could be inserted by an %@ include or jsp:include --%>
<h:inputText value="#{address}"/>
</f:subview>
<h:commandButton/>
</h:form>
Thanks for your comments.
|
Sylvain. |
