NeatUpload 1.3.4 - MultiFile control initially renders in Single file mode

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

NeatUpload 1.3.4 - MultiFile control initially renders in Single file mode

Don Adams

Using Brettle 1.3.4, IE 7, and Windows Vista. When the MultiFile control is rendered, we briefly see the control rendered in Single file mode with the textbox and pick files button to the right of the textbox, and then it switches to the MultiFile mode where there is only the pick files button and the "Powered by NeatUpload" text is below the button.

In some instances, this transition is slow enough to allow the user to press the pick files button while it is still displayed in Single file mode. If this happens, an error will occur during the postback when trying to access the MultiFile properties.

Is there a reason why the control renders this way when the MultiFile control is used? is there a way that we can get around this so that the control only renders as a MultiFile control?

Note that on this page, we have both a Single file and a MultiFile control, but they are in enclosed in separate panels so only one is rendered at a time.

Thanks for any info you can provide.

 

Reply | Threaded
Open this post in threaded view
|

Re: NeatUpload 1.3.4 - MultiFile control initially renders in Single file mode

Dean Brettle
Administrator
Is the MultiFile control within a table?  If it is, then sometimes NeatUpload can't determine the correct width/height for the "Pick Files" button until after the page has fully loaded.  In the meantime, it displays the normal single file upload control.  It might be possible to hide the single file upload control in that case by making the following addition (in bold) to NeatUpload.js around line 1300:

        if (replacementDiv.offsetHeight)
            MoveAndResizeDivAndAddFlash();
        else
        {           
            inputFile.style.display = "none";
            // Do the styling in an onload handler to support controls in tables because offsetheight isn't
            // available in tables until the page has loaded.
            nuf.AddHandler(window, "load", MoveAndResizeDivAndAddFlash);
        }
        return;

Does that fix it?  If not, can you post a small test page that I can use to reproduce the problem?

Also, are you using useFlashIfAvailable="true"? 

--Dean
Reply | Threaded
Open this post in threaded view
|

Re: NeatUpload 1.3.4 - MultiFile control initially renders in Single file mode

Don Adams

The multifile control is not within a table but it is within nested div tags. The inner most div tag sets left and right margins so perhaps that's why it has to display the single file upload control

Also, we are using the useFlashIfAvailable = "true"

Making the update fixed the problem. Thanks!

 

Reply | Threaded
Open this post in threaded view
|

Re: NeatUpload 1.3.4 - MultiFile control initially renders in Single file mode

Dean Brettle
Administrator
Fixed in 1.3.5.  Thanks for the bug report.

--Dean