Resetting hidden fields has been with us for a while ... no wonder nobody remembered what it was for (icefaces-d2d.js):
9 tedg // handle the hidden command links
9 tedg if (form_elm.type == "hidden") {
9 tedg var elm_name = form_elm.name;
9 tedg var len = elm_name.length;
9 tedg var test = elm_name.substring((len-5),len);
9 tedg if (test == "_idcl")
{
9 tedg document.forms[form.id][elm_name].value="";
9 tedg }
9 tedg }
The difficulty is that commandLink (and potentially other components) stores a value in a particular hidden field to indicate that the commandLink has been clicked. If the hidden field is not cleared, another click on the commandLink will be registered on the next user event. Clearing the hidden field in an update from the server is not practical as the server may not have the opportunity to reply in time (if the user events are rapid). By default, most components will assume that their hidden fields are cleared, because this would be the typical behavior on a full-page refresh.
Since many components are likely expecting this behaviour, we should likely keep it; however, it is also desirable to indicate that certain hidden fields not be reset.
If a naming scheme is used (such as name="retain:name") the prefix should be stripped off upon submission to allow parameters of a specified name to be used.
A reserved value of the alt tag could be used alt="retain".
A new attribute could be set: icefaces_hidden="retain".
Attached are the web pages and seam components