[ 
https://issues.apache.org/jira/browse/TAP5-1210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12890075#action_12890075
 ] 

Ben Dotte commented on TAP5-1210:
---------------------------------

This is fixed by adding a conditional if (attrs[i]) inside of the purge() 
function of tapestry.js like so:

var attrs = element.attributes;
                if (attrs) {
                        var l = attrs.length, i, name;
                        for (i = 0; i < l; i++) {
                            if (attrs[i])
                            {
                    name = attrs[i].name;
                    /* Looking for onclick, etc. */
                    if (typeof element[name] == 'function') {
                        element[name] = null;
                    }
                }
                        }
                }

> MultiZone update from EventLink with Form fails in Internet Explorer
> --------------------------------------------------------------------
>
>                 Key: TAP5-1210
>                 URL: https://issues.apache.org/jira/browse/TAP5-1210
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.0
>            Reporter: Ben Dotte
>
> A MultiZone update currently fails in Internet Explorer given the below 
> template. This works fine in Chrome and Firefox. There appears to be an 
> instance where purge() in tapestry.js is looping over elements, hits a null 
> element, and blows up trying to access .name on it. Hit the "Click Me" link; 
> notice the date does not update.
> .tml:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
> <html title="IE Test"
>       xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
>       xmlns:p="tapestry:parameter">
> <t:zone t:id="messageZone" id="messageZone">
>     ${curTime}    
> </t:zone>
> <t:form t:id="testForm" autofocus="false" zone="messageZone">
>     <t:zone t:id="formZone" id="formZone">
>         <t:eventlink event="clicked" zone="formZone">Click Me!</t:eventlink>
>         <t:textfield t:id="testName" value="testValue" class="testing" 
> maxlength="50"
>              onKeyPress="javascript:blur();"
>              
> onBlur="javascript:$('testForm').fire(Tapestry.FORM_PROCESS_SUBMIT_EVENT);"/>
>     </t:zone>
> </t:form>
> </html>
> .java:
> import org.apache.tapestry5.ajax.MultiZoneUpdate;
> import org.apache.tapestry5.annotations.InjectComponent;
> import org.apache.tapestry5.annotations.Property;
> import org.apache.tapestry5.corelib.components.Zone;
> import java.util.Date;
> public class IeTest
> {
>       @Property
>       private String testValue;
>       @InjectComponent
>       private Zone messageZone;
>       @InjectComponent
>       private Zone formZone;
>       @Property
>       private Integer curField;
>       void setupRender()
>       {
>               testValue = "test";
>       }
>       public String getCurTime()
>       {
>               return new Date().toString();
>       }
>       Object onClicked()
>       {
>               return new MultiZoneUpdate("messageZone", messageZone.getBody())
>                               .add("formZone", formZone.getBody());
>       }
>       Object onSuccess()
>       {
>               return messageZone.getBody();
>       }
> }

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