You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "David Waters (JIRA)" <de...@myfaces.apache.org> on 2008/02/27 12:23:51 UTC

[jira] Created: (TOMAHAWK-1203) Subform Javascript does not work when subform is contained within an iterator

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.


[jira] Updated: (TOMAHAWK-1203) Subform Javascript does not work when subform is contained within an iterator

Posted by "David Waters (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TOMAHAWK-1203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Waters updated TOMAHAWK-1203:
-----------------------------------

    Status: Patch Available  (was: Open)

> 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.


[jira] Updated: (TOMAHAWK-1203) Subform Javascript does not work when subform is contained within an iterator

Posted by "David Waters (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TOMAHAWK-1203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Waters updated TOMAHAWK-1203:
-----------------------------------

    Status: Open  (was: Patch Available)

> 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.