myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Dudney <bdud...@mac.com>
Subject Re: New AliasBean component
Date Wed, 10 Nov 2004 10:49:04 GMT
How about having a close that removes the alias?

So you could do;

<x:aliasBean...>
alias valid...
</x:aliasBean>
alias not valid...

So in encodeBegin(...) the alias is made and in encodeEnd(...) the 
alias is removed.

Thoughts?

I personally like this approach better because it is more explicit and 
if you have more than one subform on the same page the coming and going 
of the alias would be explicit (probably helping me find bugs, or 
preventing me from introducing them).

-bd-

On Nov 8, 2004, at 1:28 PM, Sylvain Vieujot wrote:

>  I'm about to commit a new component that allows to make a library of 
> reusable generic subforms.
>
>  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.
>
>
  

Mime
View raw message