[jsr-314-open-mirror] [jsr-314-open] [859-MultiActionComponent] RESOLVED (was: Re: Composite components only support one action) attribute (review of issue 859)

Ed Burns edward.burns at oracle.com
Thu Oct 28 14:19:39 EDT 2010


>>>>> On Thu, 28 Oct 2010 12:17:12 -0500, Leonardo Uribe <lu4242 at gmail.com> said:

LU> https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=859

LU> and then Ed Burns propose another similar one, but filling the gaps in
LU> documentation and integration with automated tests (That's cool!).

LU> Instead call it "methodType", it was proposed targetAttributeName and added
LU> this
LU> documentation:

LU> "...This attribute allows the name of the attribute exposed to the using
LU> page to differ from the one actually used in the implementation.  For
LU> example, consider a composite component that contains two buttons, one
LU> that means "submit" and one that means "cancel".  It is natural to want
LU> to declare two composite component attributes to allow these buttons to
LU> be customized, for example, "submitAction" and "cancelAction".  For both
LU> of these buttons, the method expression should be retargeted to the

LU> inner button's "action" attribute.  This scenario would be expressed as
LU> follows..."

LU> And the proposal using "targetAttributeName" looks like this:

As Martin pointed out in a private email, method-signature is optional.
So either of these are valid:

<cc:interface>
  <cc:attribute name="submitAction" targetAttributeName="action" />
  <cc:attribute name="cancelAction" targetAttributeName="action" />
</cc:interface>

<cc:interface>
  <cc:attribute name="submitAction" targetAttributeName="action" 
                method-signature="java.lang.Object action()" />
  <cc:attribute name="cancelAction" targetAttributeName="action" 
                method-signature="java.lang.Object action()" />
</cc:interface>

LU> In my opinion, the syntax using "methodType" is preferred. In that one, we
LU> are just
LU> defining the attribute is used for the behavioral interface ActionSource, as
LU> an "action",
LU> and the method-signature declaration is not necessary anymore.

I don't want to introduce the concept of type here.  We already have the
concepts of method-signature, MethodExpression, and special attribute
names.  

Therefore, I'm going with targetAttributeName.

Committed revision 8688.





LU> Note that this syntax already works (partially) without the patch:

LU>   <cc:attribute name="submitAction" method-signature="java.lang.Object
LU> action()"/>

LU> I said "partially" because these two method signatures are valid for action:

LU> java.lang.Object action()
LU> void action()

LU> The problem is more clear when "actionListener" is considered because it has
LU> these two
LU> valid signatures (since JSF 2):

LU> void method(javax.faces.event.ActionEvent )
LU> void method()

LU> It is not possible to map it using method-signature, because it only allows
LU> one of them, but
LU> if we use a notation like this:

LU>   <cc:attribute name="submitActionListener" methodType="actionListener"/>

LU> The previous two signatures are assumed and problem solved. I still think
LU> method-signature should allow multiple ones using ';', but before that (I
LU> want to propose a
LU> patch but not yet), I prefer the proposed patch using methodType.

LU> Suggestions are welcome.

LU> best regards,

LU> Leonardo Uribe

-- 
| edward.burns at oracle.com | office: +1 407 458 0017
| homepage:               | http://ridingthecrest.com/
|  9 work days until German Oracle User's Group Conference



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