<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Gang -<br>
<br>
Sorry I wasn't able to follow up on this sooner...<br>
<br>
The main reason I pushed for using the event type (eg. "click") over
the HTML attribute name (eg. "onclick") was that this is consistent
with similar technologies, such as DOM event listeners.&nbsp; When
registering a listener via the standard DOM APIs, the event type is
identified using the event name (not the "on"-prefixed attribute
name).&nbsp; That is, we specify:<br>
<br>
<blockquote type="cite">&nbsp; domElement.addEventListener("click",
listener);</blockquote>
<br>
<br>
Not:<br>
<br>
<blockquote type="cite">&nbsp; domElement.addEventListener("onclick",
listener);</blockquote>
<br>
<br>
I believe that the same approach for ClientBehaviorHolder:<br>
<br>
<br>
<blockquote type="cite">behaviorHolder.addClientBehavior("click",
behavior);</blockquote>
<br>
And by extension &lt;f:ajax&gt;:<br>
<br>
<blockquote type="cite">&nbsp; &lt;f:ajax event="click"/&gt;</blockquote>
<br>
<br>
More closely matches this well-known model.<br>
<br>
Another parallel can be found in the W3C XML Events spec:<br>
<br>
<a class="moz-txt-link-freetext" href="http://www.w3.org/TR/xml-events/Overview.html#section-listener-element">http://www.w3.org/TR/xml-events/Overview.html#section-listener-element</a><br>
<br>
Where the &lt;listener&gt; has an "event" attribute that specified the
event type (not the on-prefixed attribute name):<br>
<br>
<blockquote type="cite">&nbsp; &lt;listener event="click" observer="para1"
target="link1" handler="#clicker"/&gt;</blockquote>
<br>
Which of course is very similar to the &lt;f:ajax&gt; "event" attribute.<br>
<br>
So I think we've got the right approach in place, or at least, we are
in good company with our current approach.<br>
<br>
Rather than doubling the # of supported event names, I would like to
stick with a single set of events.&nbsp; People seem to be able to deal with
this pattern when using DOM event listeners - think we should be okay
with JSF behaviors.&nbsp; Of course, we can re-evaluate if this does become
a pain point.<br>
<br>
3rd party components are&nbsp; free to specify whatever event names they
prefer, though for the sake of consistency across component sets I do
think it would be beneficial to follow the event name conventions used
by the components in the standard HTML renderkit.<br>
<br>
One thing that I completely agree with is that we need to provide clear
error handling for cases where the page author specifies the wrong
name.&nbsp; Currently, for this invalid event name:<br>
<br>
<blockquote type="cite">&nbsp; &lt;h:commandButton&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;f:ajax event="foo"/&gt;<br>
&nbsp; &lt;/h:commandButton&gt;</blockquote>
<br>
<br>
Mojarra displays the following error message:<br>
<br>
<blockquote type="cite">/home.xhtml @73,33 &lt;f:ajax&gt; Event
attribute could not be determined: foo</blockquote>
<br>
<br>
I have opened the following Mojarra issue to request that we improve
this message:<br>
<br>
<a class="moz-txt-link-freetext" href="https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1138">https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1138</a><br>
<br>
And I have also uploaded a patch which changes the message to:<br>
<br>
<blockquote type="cite">/home.xhtml @73,33 &lt;f:ajax&gt; 'foo' is not
a supported event for<br>
HtmlCommandButton. Please specify one of these supported event names:
action,<br>
blur, change, click, dblclick, focus, keydown, keypress, keyup,
mousedown,<br>
mousemove, mouseout, mouseover, mouseup, select.</blockquote>
<br>
Hopefully this will help get our users headed in the right direction.<br>
<br>
(Oh, if one of the Mojarra guys could take a look at my patch and let
me know if I can commit it, that would be great.)<br>
<br>
Andy<br>
<br>
Martin Marinschek wrote On 5/27/2009 1:13 AM ET:
<blockquote
 cite="mid:5a99335f0905262213i6c914c51t14930a161c180f2c@mail.gmail.com"
 type="cite">
  <pre wrap="">If we disallow the on...-syntax, we need to throw an exception if
someone provides us with an on...-value for the attribute - this is
the least we can do for our users!

regards,

Martin

On 5/27/09, Roger Kitain <a class="moz-txt-link-rfc2396E" href="mailto:Roger.Kitain@sun.com">&lt;Roger.Kitain@sun.com&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">I thought one of the reasons was that the "event" f:ajax attribute also
supports "valueChange" (for example) which is not a DOM event ..
I suppose we could change the docs to say that this attribute supports
the standard DOM events in addition to the faces events
"valueChange" (for EditableValueHolders) and "action" (for ActionSource)...

-roger

Andy Schwartz wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">Dan Allen wrote:
      </pre>
      <blockquote type="cite">
        <pre wrap="">Anyone else on the EG have any thoughts about supporting both
derivations today?
        </pre>
      </blockquote>
      <pre wrap="">I do, since I was the one who pushed for the current solution.  :-)

Will follow up with my thinking as soon as I get some free cycles here.

Andy

      </pre>
      <blockquote type="cite">
        <pre wrap="">-Dan

--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action

<a class="moz-txt-link-freetext" href="http://mojavelinux.com">http://mojavelinux.com</a>
<a class="moz-txt-link-freetext" href="http://mojavelinux.com/seaminaction">http://mojavelinux.com/seaminaction</a>
<a class="moz-txt-link-freetext" href="http://in.relation.to/Bloggers/Dan">http://in.relation.to/Bloggers/Dan</a>

NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a
week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters.  Please don't hesitate to resend a
message if
you feel that it did not reach my attention.
        </pre>
      </blockquote>
    </blockquote>
    <pre wrap="">
    </pre>
  </blockquote>
  <pre wrap=""><!---->

  </pre>
</blockquote>
<br>
</body>
</html>