[jsr-314-open-mirror] [jsr-314-open] composite components: targets attribute revisited

Martin Marinschek mmarinschek at apache.org
Fri Oct 29 06:05:17 EDT 2010


Hi Gentlemen,

I am leaning toward Jakob's approach, but if it is not possible due to
the constraints Leonardo mentioned, then why not add the necessary
tags?

@Leonardo, Jakob: can you put your heads together and come up with a
combined proposal?

best regards,

Martin

On 10/29/10, Ed Burns <edward.burns at oracle.com> wrote:
>>>>>> On Thu, 28 Oct 2010 12:56:53 -0500, Leonardo Uribe <lu4242 at gmail.com>
>>>>>> said:
>
> LU> Hi
> LU> To be more explicit, this is the example that should fail:
>
> LU> <ez:loginPanel id="loginPanel" model="#{bean}">
> LU>        <f:actionListener for="loginEvent"
> LU>                          binding="#{bean.loginEventListener}" />
> LU>        <f:actionListener for="loginEvent"
> LU>                          binding="#{bean.loginEventListener2}" />
> LU>        <f:actionListener for="cancelEvent"
> LU>                          binding="#{bean.cancelEventListener}" />
> LU>      </ez:loginPanel>
>
> LU>      <composite:interface name="loginPanel">
> LU>        <composite:actionSource name="loginEvent" />
> LU>        <composite:actionSource name="cancelEvent" />
> LU>      </composite:interface>
> LU>      <composite:implementation>
> LU>                  <h:commandButton name="button1">
> LU>                         <f:actionListener
> LU> binding="#{cc.actionSource.loginEvent}"/>
> LU>                  </h:commandButton>
> LU>                  <x:mycompositecomponent name="button2">
> LU>                         <f:actionListener
> LU> binding="#{cc.actionSource.cancelEvent}" for="someOtherEvent"/>
> LU>                  </x:mycompositecomponent>
> LU>      </composite:implementation>
>
> LU> In this case, the binding #{cc.actionSource.loginEvent} does not point
> to
> LU> just
> LU> one actionListener.
>
> GP> Leo, IMO your example wouldn't need to fail: the nested
> GP> actionListener with binding="#{cc.actionSource.loginEvent}" would
> GP> need to execute *all* actionListeners that have been bound to
> GP> "loginEvent". In this case "#{bean.loginEventListener}" and
> GP> "#{bean.loginEventListener2}" would reside in a Map named
> GP> cc.actionSource.loginEvent and could both be executed. Wouldn't this
> GP> work?
>
> The type of the binding attribute is specified thus.
>
>   Value binding expression that evaluates to an object that implements
>   javax.faces.event.ActionListener
>
> How would you make that handle a list?
>
> Sure, we could go and add a raft of new "bindingList" attributes to all
> of the attached object handlers in f:, but is it worth the complexity?
>
>
> Ed
> --
> | edward.burns at oracle.com | office: +1 407 458 0017
> | homepage:               | http://ridingthecrest.com/
> |  9 work days until German Oracle User's Group Conference
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces



More information about the jsr-314-open-mirror mailing list