Hi Alexander/Ganesh there are two parts of the spec one being the PDF
the other being the JavaDocs and JSDocs, you can find the issue in the
JSDocs for jsf.ajax.response specifically in the section dealing with
the updates in the responseXML!
here is the section:
If an update element is found in the response with the identifier
javax.faces.ViewState:
..... snip other behavior
if the <form> element does not contain an element with the identifier
javax.faces.ViewState, create an <input> element of the type hidden,
with the identifier javax.faces.ViewState, set its contents to the
<update> element's CDATA contents, and add the <input> element as a
child to the <form> element.
note the term identifier here, which leaves no discussion that the id
has to be used identifier == id in my opinion not the name which would
be the proper way to resolve this in a html conform manner!
Werner
Alexander Bell schrieb:
Hi,
in the past we did it in this way that we looking for the element only
in the affected form.
So in the form there is only one element with the id javax.faces.ViewState.
It is also necessary that every form contains a hidden field with this
id. So for JSF ok but it breaks the w3c standard and you can't use
document.getElementById.
We've got a appropriate code snippet in the j4fry code.
2009/4/19 Ganesh <gan...@j4fry.org <mailto:gan...@j4fry.org>>
Hi Werner,
2 elements with the same id truely brake the HTML standard. And it's
true, with Mojarra 2.0 and 2 forms on a page I get 2 identical
<input id="javax.faces.ViewState" type="hidden" value="j_id1:j_id2"
name="javax.faces.ViewState"/>
elements!
Still, I'm not able to find this in the specs, can you please point
me to the section you are referring to?
The spec says that an element with the identifier
javax.faces.ViewState has to be added to every form if it does
not exist within the update phase if viewState itself is responded!
Best Regards,
Ganesh
--
Mit freundlichen Grüßen / Kind regards
Alexander Bell
J4Fry OpenSource Community
Internet: http://www.j4fry.org
E-Mail: alexander.b...@j4fry.org <mailto:alexander.b...@j4fry.org>
Webprofil: http://www.j4fry.org/alexanderbell.shtml