jsr344-experts@javaserverfaces-spec-public.java.net

[jsr344-experts] Re: [SPEC-901] PROPOSAL: Close 901, fix 755

From: Ed Burns <edward.burns_at_oracle.com>
Date: Mon, 25 Jul 2011 17:04:06 -0700

>>>>> On Thu, 21 Jul 2011 23:15:21 -0500, Leonardo Uribe <lu4242_at_gmail.com> said:

[...]

LU> The previous example has something missing. Cancel button will work,
LU> because the name used in "for" does not change ("cancelButton")
LU> between the nested composite components, but you can't redirect
LU> loginButton to okButton. Note "targets" points to two components. Note

This is why it's important to have composite components be
NamingContainers. I assume when you say "you can't redirect loginButton
to okButton" you mean the okButton in the okCancelPanel composite
component. Why doesn't the following work in this case:

8<-----------------------------

okCancelPanel.xhtml

<cc:interface>
    <cc:actionSource name="okButton"/>
    <cc:actionSource name="cancelButton"/>
</cc:interface>

loginPanel.xhtml

<cc:interface>
    <cc:actionSource name="loginButton"
                     targets="panel:okButton otherActionSource"/>
    <cc:actionSource name="cancelButton" targets="panel"/>
</cc:interface>
<cc:implementation>
    <test:okCancelPanel id="panel">
        <!-- .... some stuff here ... -->
    </test:okCancelPanel>
    <yy:otherActionSourceComponent id="otherActionSource" />
</cc:implementation>

using page:

<test:loginPanel>
   <f:actionListener for="loginButton" ... />
   <f:actionListener for="cancelButton" ... />
</test:loginPanel>

8<-----------------------------

Now, it's possible the current implementations don't support this, but
because you are trying to make it so attached objects intended to go to
loginPanel's loginButton attach-point are redirected to the okButton
within okCancelPanel, it seems this is exactly the syntax you'd want.

Please correct me if I'm wrong.

Ed

-- 
| edward.burns_at_oracle.com | office: +1 407 458 0017
| homepage:               | http://ridingthecrest.com/