Jörn Zaefferer wrote:
On 3/1/07, *Simon Kitching* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
I believe it is (see my earlier reply), and that all the javascript is
doing is ensuring any garbage left behind by h:commandLink tags is
cleaned up (hidden fields _idcl and _link_hidden_).
Ok, but that doesn't explain the JavaScript for an input of type submit.
From what I understood so far, the commandLink copy some values to
hidden fields before triggering the form submit. So by clicking a submit
button, those hidden fields shouldn't have any values...
True in most cases.
However it is possible for someone to click a commandLink, then click a
submit button (before the response is received). In this case the second
request will have the hidden field set to the command-link properties
which will have unexpected consequences for the user.
I'm only guessing, but presume this is the reason for clearing these
fields even from a submit button. I can't think of another one offhand;
as you say, in normal use these should be empty.
I guess it came from my frustration with JSF in general: While the
programming model is great, I don't like the "output" JSF produces.
While that may be acceptable for prototyping and intranet application, I
wouldn't want to have that on a public website. My understanding of JSF
and MyFaces is still too small to really understand why that is
necessary or how it could be improved.
I'm not too fond of some of the currently generated HTML/script either.
I *think* I can see significant potential for improvement. However until
I have time to actually code and test a patch to fix it I'm reluctant to
criticise. There may be reasons that it is the way it is, which I would
find out when I try to implement an alternative. Or the code author may
just have been short of time to optimise.
Cheers,
Simon