I take back my previous concept. I think making the parameters optional is good enough. No need for anything fancy.<br><br>+1 for my own first thought, lol<br><br><div class="gmail_quote">On Fri, Jan 22, 2010 at 7:50 PM, Cagatay Civici <span dir="ltr">&lt;<a href="mailto:cagatay.civici@gmail.com">cagatay.civici@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">+1 as well, most of the time it&#39;s a burden to add the unused event parameter.<br>
<font color="#888888"><br>
Cagatay<br>
</font><div><div></div><div class="h5"><br>
On Jan 22, 2010, at 8:08 PM, Jason Lee wrote:<br>
<br>
&gt; +1<br>
&gt;<br>
&gt; I&#39;d wager that half the time I don&#39;t need the parameter I&#39;m required to pass in, so I&#39;d love to this made optional.  Officially<br>
&gt;<br>
&gt; On 1/22/10 1:57 PM, Andy Schwartz wrote:<br>
&gt;&gt; Cay Horstmann wrote:<br>
&gt;&gt;&gt; On 01/22/2010 08:52 AM, Kito Mann wrote:<br>
&gt;&gt;&gt;&gt; Personally, I don&#39;t think there&#39;s anything wrong with having a signature<br>
&gt;&gt;&gt;&gt; that requires an event listener. Isn&#39;t that how most UI toolkits work?<br>
&gt;&gt;&gt;&gt; What about Swing or SWT?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I do understand the desire to have some code completely decoupled,<br>
&gt;&gt;&gt;&gt; though. If we make the signature optional, though, I&#39;m afraid that&#39;ll be<br>
&gt;&gt;&gt;&gt; even more confusing for users.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I don&#39;t think it is confusing to say &quot;This parameter is optional&quot;. Lots of things are optional in JSF.<br>
&gt;&gt;<br>
&gt;&gt; Yep.  Actually, for the nearest equivalent to this use case - h:commandButton&#39;s actionListener - we have specified that the ActionEvent is now optional (as of 2.0 I believe).  From the tag doc:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; The expression must evaluate to a public method that takes an ActionEvent parameter, with a return type of void, or to a public method that takes no arguments with a return type of void. In the latter case, the method has no way of easily knowing where the event came from, but this can be useful in cases where a notification is needed that &quot;some action happened&quot;.<br>

&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Given that, my take is that:<br>
&gt;&gt;<br>
&gt;&gt; 1. Our biggest risk of confusion would be to have the the spec be inconsistent between these cases.<br>
&gt;&gt; 2. The behavior specified for actionListener (event parameter is optional) is the preferred behavior.  (We intentionally added this behavior in 2.0).<br>
&gt;&gt; 3. The fact that Mojarra implements this behavior for f:event&#39;s listener attribute as well is a good thing (and probably intentional).<br>
&gt;&gt; 4. We should update the spec in our upcoming MR to clarify that the current behavior is by design.<br>
&gt;&gt;<br>
&gt;&gt; I have logged the following spec issue to track this:<br>
&gt;&gt;<br>
&gt;&gt; <a href="https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=731" target="_blank">https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=731</a><br>
&gt;&gt;<br>
&gt;&gt; Andy<br>
&gt;&gt;<br>
&gt;&gt;&gt; The reason you want to make it so is to have a better unit testing story.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Cay<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Jason Lee, SCJP<br>
&gt; President, Oklahoma City Java Users Group<br>
&gt; Senior Java Developer, Sun Microsystems<br>
&gt; <a href="http://blogs.steeplesoft.com" target="_blank">http://blogs.steeplesoft.com</a><br>
&gt;<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.com">http://ocpsoft.com</a><br><a href="http://scrumshark.com">http://scrumshark.com</a><br>&quot;Keep it Simple&quot;<br>