Hi!
why not getElementsByName[0] ?
Well, in general document.getElementById is both faster and more elegant.
So in this case, rendering this component with id=clientId seems reasonable.
Hmm..but it is possible that there are multiple "view state" fields in
the page, one per form. So perhaps using "getElementsByName" is a good
idea in this specific case.
And also ensure that every ViewState will be replaced and not only the
first [0] one.
When you do have multiple JSF forms (which is valid) each ViewState
needs to be replaced.
Ciao,
Mario