Description
The SubFormRenderer.createPartialSubmitJS takes in only the last component of the ID as such cannot work in a repeating environment
e.g.
<tr:iterator ...>
<s:subform id="a" >
...
<t:commandButton actionfor="a" .../>
...
</s:subform>
</tr:iterator>
Results in things like
<input ...>
<script type="text/javascript">function a_submit() {
var form = document.forms['questionsForm'];
var el = document.createElement("input");
el.type = "hidden";
el.name = "org.apache.myfaces.custom.subform.submittedId";
el.value = "a";
form.appendChild(el);
form.submit();
}
</script>
<input ..>
<script type="text/javascript">function a_submit() {
var form = document.forms['questionsForm'];
var el = document.createElement("input");
el.type = "hidden";
el.name = "org.apache.myfaces.custom.subform.submittedId";
el.value = "a";
form.appendChild(el);
form.submit();
}
</script>
<input ...>
<script type="text/javascript">function a_submit() {
var form = document.forms['questionsForm'];
var el = document.createElement("input");
el.type = "hidden";
el.name = "org.apache.myfaces.custom.subform.submittedId";
el.value = "a";
form.appendChild(el);
form.submit();
}
</script>
as you can see the function name is repeated 3 times
function a_submit()
function a_submit(){...}
function a_submit()
{...}And the value of the hidden field is not distinguishable.
The resolution would be to use the clientID with : swaped out as the function name, the value of the hiddenField, and the value checked to see if this field was submitted.
Thanks,
David.