Subform Javascript does not work when subform is contained within an iterator
-----------------------------------------------------------------------------

                 Key: TOMAHAWK-1203
                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1203
             Project: MyFaces Tomahawk
          Issue Type: Bug
          Components: SubForm
            Reporter: David Waters


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.




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to