You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2009/11/03 21:35:32 UTC

[jira] Resolved: (MYFACES-2256) oamSetHiddenInput should not ignore nodeName=='input' (lower case characters)

     [ https://issues.apache.org/jira/browse/MYFACES-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved MYFACES-2256.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.2.8-SNAPSHOT
         Assignee: Leonardo Uribe

Thanks to Lutz Ulruch for this patch

> oamSetHiddenInput should not ignore nodeName=='input' (lower case characters)
> -----------------------------------------------------------------------------
>
>                 Key: MYFACES-2256
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2256
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.2.6
>         Environment: Windows XP Professional, Firefox 3.0.11, MyFaces 1.2.6 Tomahawk-12 1.1.8 (and RichFaces 3.3.1 GA), Tomcat 6.
>            Reporter: Lutz Ulruch
>            Assignee: Leonardo Uribe
>             Fix For: 1.2.8-SNAPSHOT
>
>
> In 
> function oamSetHiddenInput(formname, name, value) 
> the test
> if(typeof form.elements[name]!='undefined' && form.elements[name].nodeName=='INPUT')
> does not cover <input> elements where nodeName is 'input' (that is: lower case characters instead of upper case 'INPUT').
> This results in the following error:
> If the form already contains an input element with the specified name, but nodeName=='input', the test fails and a new input element with the same name is added to the form.
> If the form is submitted, the HTTP request will contain 2 values for the parameter referenced by 'name':
> one is the value of the unchanged <INPUT> field, the other is the value of the newly created <input> field.
> Most UIComponents do not check if there is more than one value for a parameter. 
> Probably they will just interpret the first value - which might be the 'wrong' value of the <INPUT> field instead of the 'valid' value of the <input> field.
> How I achieved this situation:
> Even though MyFaces typically renders input fields with lower case characters (XHTML), when a page is rendered by Firefox, the nodeName of input elements seems to be the upper case variant. I wonder why.
> Now, we use RichFaces' a4j:poll in order to perform periodical partial page updates.
> The updated part of the page may contain locically equivalent input fields, but in lower case.
> The JavaScript behind a4j:poll uses the W3C DOM method replaceChild() in order to update page fragments.
> This method replaces the original <INPUT> fields by <input> fields.
> Of course, it doesn't matter how <input> elements become part of a page. 
> In oamSetHiddenInput() <input> should be treated like <INPUT>.

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