You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Boris Horvat (Created) (JIRA)" <ji...@apache.org> on 2012/04/13 05:55:41 UTC

[jira] [Created] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Bug that affects the javascript when a zone which contains an upload component is re render 
--------------------------------------------------------------------------------------------

                 Key: TAP5-1903
                 URL: https://issues.apache.org/jira/browse/TAP5-1903
             Project: Tapestry 5
          Issue Type: Bug
          Components: tapestry-upload
    Affects Versions: 5.3.2
            Reporter: Boris Horvat
            Priority: Minor


I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this

 <t:zone t:id="zone">
          <t:form t:id="form">
                <input t:type="upload" t:value="value" />
           </t:form>                
 </t:zone>

once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 

what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 

Tapestry.Initializer.injectedUpload = function(element) 
{ 
    var form = $(element).form; 

    form.enctype = "multipart/form-data"; 
    form.encoding = "multipart/form-data"; 
} 

$(element).form returns null for partial updates. 

the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js

the solution that worked for me is 

Tapestry.Initializer.injectedUpload = function(element) 
{ 
   var form = $(element).form; 

   if(form){ 
      form.enctype = "multipart/form-data"; 
      form.encoding = "multipart/form-data"; 
   } 
} 

two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 

 var form = $(element).form; 

is not working and the solution about works

One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page

the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship reopened TAP5-1903:
----------------------------------------

    
> Bug that affects the javascript when a zone which contains an upload component is re render 
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Assignee: Bob Harner
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>             Fix For: 5.3.6, 5.4
>
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Posted by "Bob Harner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bob Harner resolved TAP5-1903.
------------------------------

       Resolution: Fixed
    Fix Version/s: 5.4
                   5.3.6

Fixed in 5.3 branch with rev 1194bdf3fed79d7b4d5ae53d44a0fec64c12a3a5, and trunk/master rev a0600d223113121e1ba7408258752d5a55f3219c
                
> Bug that affects the javascript when a zone which contains an upload component is re render 
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Assignee: Bob Harner
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>             Fix For: 5.3.6, 5.4
>
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Posted by "Boris Horvat (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Boris Horvat updated TAP5-1903:
-------------------------------

     Affects Version/s: 5.3.3
                        5.3.4
                        5.3.5
    Remaining Estimate: 1h
     Original Estimate: 1h
    
> Bug that affects the javascript when a zone which contains an upload component is re render 
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Posted by "Bob Harner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13456723#comment-13456723 ] 

Bob Harner commented on TAP5-1903:
----------------------------------

I applied the patch and committed to master but am having Git problems trying to get it into the 5.3 branch, hopefully fixed soon.
                
> Bug that affects the javascript when a zone which contains an upload component is re render 
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Assignee: Bob Harner
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Reopened] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship reopened TAP5-1903:
----------------------------------------

    
> Bug that affects the javascript when a zone which contains an upload component is re render 
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Assignee: Bob Harner
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>             Fix For: 5.3.6, 5.4
>
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Posted by "Bob Harner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bob Harner reassigned TAP5-1903:
--------------------------------

    Assignee: Bob Harner
    
> Bug that affects the javascript when a zone which contains an upload component is re render 
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Assignee: Bob Harner
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Posted by "Boris Horvat (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Boris Horvat updated TAP5-1903:
-------------------------------

    Attachment: javascript_upload_rerender.patch

This is the patch for the problem
                
> Bug that affects the javascript when a zone which contains an upload component is re render 
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Posted by "Bob Harner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bob Harner reassigned TAP5-1903:
--------------------------------

    Assignee: Bob Harner
    
> Bug that affects the javascript when a zone which contains an upload component is re render 
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Assignee: Bob Harner
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (TAP5-1903) Client-side exception when a Zone containing a Form with an Upload component is re-rendered

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-1903:
---------------------------------------

    Summary: Client-side exception when a Zone containing a Form with an Upload component is re-rendered  (was: Bug that affects the javascript when a zone which contains an upload component is re render )
    
> Client-side exception when a Zone containing a Form with an Upload component is re-rendered
> -------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Assignee: Bob Harner
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>             Fix For: 5.3.6, 5.4
>
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Posted by "Bob Harner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13456723#comment-13456723 ] 

Bob Harner commented on TAP5-1903:
----------------------------------

I applied the patch and committed to master but am having Git problems trying to get it into the 5.3 branch, hopefully fixed soon.
                
> Bug that affects the javascript when a zone which contains an upload component is re render 
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Assignee: Bob Harner
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Posted by "Bob Harner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bob Harner closed TAP5-1903.
----------------------------

    
> Bug that affects the javascript when a zone which contains an upload component is re render 
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Assignee: Bob Harner
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>             Fix For: 5.3.6, 5.4
>
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Posted by "Bob Harner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457729#comment-13457729 ] 

Bob Harner commented on TAP5-1903:
----------------------------------

Fix applied to 5.3 branch today, 1194bdf3fed79d7b4d5ae53d44a0fec64c12a3a5
                
> Bug that affects the javascript when a zone which contains an upload component is re render 
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Assignee: Bob Harner
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Posted by "Bob Harner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bob Harner resolved TAP5-1903.
------------------------------

       Resolution: Fixed
    Fix Version/s: 5.4
                   5.3.6

Fixed in 5.3 branch with rev 1194bdf3fed79d7b4d5ae53d44a0fec64c12a3a5, and trunk/master rev a0600d223113121e1ba7408258752d5a55f3219c
                
> Bug that affects the javascript when a zone which contains an upload component is re render 
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Assignee: Bob Harner
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>             Fix For: 5.3.6, 5.4
>
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Posted by "Bob Harner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bob Harner closed TAP5-1903.
----------------------------

    
> Bug that affects the javascript when a zone which contains an upload component is re render 
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Assignee: Bob Harner
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>             Fix For: 5.3.6, 5.4
>
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Posted by "Boris Horvat (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Boris Horvat updated TAP5-1903:
-------------------------------

    Attachment: javascript_upload_rerender.patch

This is the patch for the problem
                
> Bug that affects the javascript when a zone which contains an upload component is re render 
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (TAP5-1903) Client-side exception when a Zone containing a Form with an Upload component is re-rendered

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAP5-1903.
--------------------------------------

    Resolution: Fixed
    
> Client-side exception when a Zone containing a Form with an Upload component is re-rendered
> -------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Assignee: Bob Harner
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>             Fix For: 5.3.6, 5.4
>
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (TAP5-1903) Client-side exception when a Zone containing a Form with an Upload component is re-rendered

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-1903:
---------------------------------------

    Summary: Client-side exception when a Zone containing a Form with an Upload component is re-rendered  (was: Bug that affects the javascript when a zone which contains an upload component is re render )
    
> Client-side exception when a Zone containing a Form with an Upload component is re-rendered
> -------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Assignee: Bob Harner
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>             Fix For: 5.3.6, 5.4
>
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Posted by "Boris Horvat (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Boris Horvat updated TAP5-1903:
-------------------------------

     Affects Version/s: 5.3.3
                        5.3.4
                        5.3.5
    Remaining Estimate: 1h
     Original Estimate: 1h
    
> Bug that affects the javascript when a zone which contains an upload component is re render 
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (TAP5-1903) Client-side exception when a Zone containing a Form with an Upload component is re-rendered

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAP5-1903.
--------------------------------------

    Resolution: Fixed
    
> Client-side exception when a Zone containing a Form with an Upload component is re-rendered
> -------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Assignee: Bob Harner
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>             Fix For: 5.3.6, 5.4
>
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (TAP5-1903) Bug that affects the javascript when a zone which contains an upload component is re render

Posted by "Bob Harner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457729#comment-13457729 ] 

Bob Harner commented on TAP5-1903:
----------------------------------

Fix applied to 5.3 branch today, 1194bdf3fed79d7b4d5ae53d44a0fec64c12a3a5
                
> Bug that affects the javascript when a zone which contains an upload component is re render 
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1903
>                 URL: https://issues.apache.org/jira/browse/TAP5-1903
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5
>            Reporter: Boris Horvat
>            Assignee: Bob Harner
>            Priority: Minor
>              Labels: ajax, javascript, jquery, upload
>         Attachments: javascript_upload_rerender.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have run into an issue with javascript that runs after the zone which contains an upload component is re rendered. The code would look like this
>  <t:zone t:id="zone">
>           <t:form t:id="form">
>                 <input t:type="upload" t:value="value" />
>            </t:form>                
>  </t:zone>
> once this is rendered the javascript would send an error TypeError: Cannot set property 'enctype' of undefined [http://localhost:8080/assets/0.55-SNAPSHOT/jquery/tapestry-jquery.js:904] 
> what happens is that once the ajax starts to work the Upload component (Upload.java) sends the code that is to be executed 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>     var form = $(element).form; 
>     form.enctype = "multipart/form-data"; 
>     form.encoding = "multipart/form-data"; 
> } 
> $(element).form returns null for partial updates. 
> the code for that can be found https://github.com/apache/tapestry5/blob/trunk/tapestry-upload/src/main/resources/org/apache/tapestry5/upload/components/upload.js
> the solution that worked for me is 
> Tapestry.Initializer.injectedUpload = function(element) 
> { 
>    var form = $(element).form; 
>    if(form){ 
>       form.enctype = "multipart/form-data"; 
>       form.encoding = "multipart/form-data"; 
>    } 
> } 
> two more thing that are maybe worth to mention is that I was using tapestry-jquery plugin (but since this code comes from the tapestry core and it has nothing to do with jquery I think that it is irrelevant). the second thing is that the reason this error shows up is because what is send from the ajax (along with the code that is to be executed in javascript) is the list of components (in my case it was a list of 6) 5 textfields and 1 upload. All of them apart from upload where return as objects the upload was returned from ajax was a string which is why the 
>  var form = $(element).form; 
> is not working and the solution about works
> One other thing to mention is that this error does not affect java code only the javascript since an error is thrown so javascript stops to work on the page
> the discussion on the forum can be found here  http://tapestry.1045711.n5.nabble.com/Zone-refresh-image-uplaod-td5631622.html#a5634387

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira