<div class="gmail_quote">On Mon, Aug 17, 2009 at 7:21 PM, Jim Driscoll <span dir="ltr">&lt;<a href="mailto:Jim.Driscoll@sun.com">Jim.Driscoll@sun.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;">
<div class="im">On 8/17/09 1:25 PM, Ed Burns wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

On Wed, 12 Aug 2009 14:27:37 -0700, Jim Driscoll&lt;Jim.Driscoll@Sun.COM&gt;  said:<br>
</blockquote></blockquote></blockquote></blockquote></blockquote>
<br>
JD&gt;  So, in the interests of making all browsers behave similarly, I&#39;ve<br>
JD&gt;  changed the default behavior to onclick for those components.<br>
<br>
I agree with this modification.  I didn&#39;t see anything in the<br>
ChangeLog[1].  Can you add it, please, Jim.<br>
</blockquote>
<br></div>
It&#39;s not a spec change - the spec doesn&#39;t specify exactly what behavior happens for the default event.  This is by (good) design.<br>
<br>
I don&#39;t think we should specify any of this in the spec, but merely try our best to actually reflect a &quot;valueChanged&quot; event - however that may be.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Jim, I&#39;d still like to see your answer to Dan Allen&#39;s question about,<br>
&quot;can we manually emulate the real, onchange behavior by doing some kind<br>
of old/new comparison&quot;.  However, I must say that I don&#39;t personally<br>
think the extra logic is worth it.<br>
</blockquote>
<br></div>
There are other issues about this, which I&#39;ve been trying to look at today.  I&#39;d delayed answering because my research on it isn&#39;t complete.<br>
<br>
As a partial summary of what I&#39;ve found:  blur() won&#39;t work - it messes with accessibility.  blur() would need to be followed by focus() - and now it&#39;s getting really messy - imagine the escape handling you&#39;d have to code in to not spuriously call a user supplied onfocus handler. Though in all honesty, that may be the cleanest solution - if we really want one.<br>

<br>
<br>
The component&#39;s value is already changed in the actual (click) event itself, so you can&#39;t do any testing there.  You could cache the complete value list (in some sort of body onload method *shudder*), but that&#39;s probably a bad idea too - and would fail on programmatic change of the selected values anyway (which is alarmingly common) - though that also causes a simple onchange handler to also fail on some browsers.<br>

<br>
You could also set up a timer that periodically checked for value changes, executing on, say, a 50 ms interval.  That seems like a lot of bother to get around seeing an extra click on a radio button - but I suppose that would work.  Of course, you&#39;d be writing a bunch of code out into the rendered page - and that code could be vulnerable if you&#39;re doing ajax updates of those values, so you&#39;d have to route it through there.  And then you&#39;d be spawning new executable code in JavaScript on a timer - probably one for each radio set, unless you really want to get fancy.  I shudder to think of what that would do to an IE6 client on a slow machine, if they hit a page with a fair number of radio buttons.<br>

<br>
So, in short, no, it appears we can&#39;t (easily)  fix this.  It&#39;s broken.  The best option will probably be to have slightly inconsistent behavior, that&#39;s at least *predictably* inconsistent in all environments.  (I.e. - you&#39;ll get onclick behavior for things, and onchange behavior for others)   Remember, onclick behavior is just fine for checkboxes - every check changes state anyway.  So we&#39;re really just talking about radio buttons.  Where submitting twice would matter - that&#39;s starting to sound pretty much list a vague edge case.<br>

<br>
SO it seems like we&#39;re stuck with what we currently have - it&#39;s minorly flawed, but not as flawed as every other way I can think of doing it.</blockquote><div><br>Thanks for doing this research Jim. If nothing else, you should preserve this in an FAQ.<br>
<br>It reminds me how pathetic HTML/JavaScript is after all of these years (or perhaps just IE). You&#39;d think that this stuff would have been fixed by now. If JSF can&#39;t solve the problem in a simple way, then perhaps would should just say it isn&#39;t JSF&#39;s concern. I suppose third party frameworks can put in all the interval checking they want.<br>
</div></div><br>-Dan<br clear="all"><br>-- <br>Dan Allen<br>Senior Software Engineer, Red Hat | Author of Seam in Action<br>Registered Linux User #231597<br><br><a href="http://mojavelinux.com">http://mojavelinux.com</a><br>
<a href="http://mojavelinux.com/seaminaction">http://mojavelinux.com/seaminaction</a><br><a href="http://in.relation.to/Bloggers/Dan">http://in.relation.to/Bloggers/Dan</a><br>