You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Tzvetanov Grigorov (Jira)" <ji...@apache.org> on 2021/10/19 18:20:00 UTC

[jira] [Resolved] (WICKET-6926) Timer action on FileUploadField causes javascript error

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

Martin Tzvetanov Grigorov resolved WICKET-6926.
-----------------------------------------------
    Resolution: Duplicate

Please see WICKET-6921.

There is a workaround explained in the comments.

> Timer action on FileUploadField causes javascript error
> -------------------------------------------------------
>
>                 Key: WICKET-6926
>                 URL: https://issues.apache.org/jira/browse/WICKET-6926
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 9.5.0
>         Environment: MacOS 11.6, multiple browsers
>            Reporter: Erwin Starke
>            Priority: Major
>         Attachments: bugUploadTimer quickstart.zip
>
>
> Since 9.5.0, the combination of (Multi)FileUploadField and AbstractAjaxTimerBehavior will result in javascript errors, which will prevent other javascript events later on from completing (e.g. LazyLoadPanels that will be built on the same page in the future, which has been omitted in the quickstart).
> The bug occurs when a FileUploadField is present on a Page where an AbstractAjaxTimerBehavior is fired. The timer can be on a component not related to the FileUploadField or its Form (see quickstart for example regarding sibling component for the Form). During the timer the following error shows on the browser console:
>  * Chrome (94.0.4606.81): Uncaught TypeError: Cannot read properties of null (reading 'form')
>  * Safari (15.0): TypeError: null is not an object (evaluating 'Wicket.$('files5').form')
> Issue appears to be that the wicket-id for the component is not set in the resulting HTML-file, causing the evaluation of the statement above to generate a NullPointer. Unsure where the script call is coming from.
> Marking the FormComponent with .setOutputMarkupId(true) will temporarily solve the issue as the wicket-id will be added to the HTML, but this workaround is insufficient when the component is not present on the page (e.g. when the form is not yet visible in a dedicated save&edit component as demonstrated in the quickstart).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)