Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#9793 closed defect (fixed)

FileUploader in TabContainer fails

Reported by: Mike Wilcox Owned by: Mike Wilcox
Priority: high Milestone: 1.5
Component: DojoX Form Version: 1.4.0
Keywords: Cc:
Blocked By: Blocking:

Description

When using FileUploader? in a TabContainer? and the Flash is built in a tab that is not selected (ergo, visible), there is an error: this.movie.percentageload() failed

The problem is the SWF cannot be created in a dom node that isn't visible. There is currently not a plan to fix this, as it would require a custom solution (I'm open to a suggestion that's doable)

There are workarounds however:

Have the SWF Tab be the one selected (this one is obvious and least likely to be desired)

Have the SWF Tab be the one selected and programmatically change the tab after creation. The problem with this is loading the SWF takes a long time (as long as a second) and the change in the UI will be noticeable. The change of the UI could be covered by a "loading" div however. The code would look something like:

dojo.connect(fileUploader, "onReady", function(){ dijit.byId("myTabContainer").selectChild(dijit.byId("theOneWanted")) });

You could defer the load of the tab contents that contains the FileUploader?. Unfortunately there is no easy way to tell the TabContainer? to not load content until it is displayed. One way is to use an external HTML file. Another would be to listen for the tab selection and load the FileUploader? programmtically.

The final workaround is to use force:"html" and not use Flash.

Change History (5)

comment:1 Changed 10 years ago by Mike Wilcox

Milestone: tbdfuture

comment:2 Changed 10 years ago by Mike Wilcox

(In [20641]) Refs #10104, #9996, #9793, Fixes #10196 - fixed style regressions. Also added some groundwork for making FileUploader? work in Dialog and TabContainer? (the ability to be initially hidden... tricky task)

comment:3 Changed 10 years ago by mtyson

I tried using the fileuploader inside a tabContainer. I get the error 'this.button is null'. I thought it might work because the tab is not hidden, it is dynamically added to the container, and contains the fileUploader in it (ie, the fileuploader button is dynamically created along with the tab). I tried both programmatically and declaratively creating the uploader, with the same results.

comment:4 Changed 10 years ago by Mike Wilcox

Resolution: fixed
Status: newclosed

(In [21399]) Fixes #9793 - Fixed bug with FileUploader? being created in a TabContainer? BUT it is only a partial solution, as changing tabs reinitializes the uploader in Firefox and Safari. There is no known solution for this. This commit includes a workaround.

comment:5 Changed 10 years ago by Mike Wilcox

Milestone: future1.5
Version: 1.3.21.4.0

See form/tests/test_FileUploaderTabs.html for the workaround. It floats a div above the tab container and moves it on and off screen as the tab is toggled.

Note: See TracTickets for help on using tickets.