I've managed to fix a bug I was having revolving around Safari WOFileUpload & Hidden Divs and thought I'd share. Unfortunately it's a hack involving Javascript but it works.

The problem itself manifests itself when you have a WOForm with a WOFileUpload which when it is submitted has the WOFileUpload in a part of the page that is hidden. On the first Submit everything will be fine, if you submit again you get a dreaded "No form data left for WOFileUpload"

It seems related to this
http://lists.apple.com/archives/Webobjects-dev/2005/Sep/msg00471.html

and this
http://lists.apple.com/archives/Webobjects-dev/2005/Mar/msg00362.html
(the solution of binding enctype to a local string type did nothing for me)

So heres the Javascript, it's done in Jquery to keep it simple

<!-- A Crazy fix for the Safari WOFileUpload in a hidden div Bug -->
<script>$(document).ready(function(){
        if ($.browser.safari) {
//Show any hidden divs that contain a WOFileUpload when a form is submitted
                $("[EMAIL PROTECTED]").click( function(){
                        $("div.wofileupload:hidden").each(function(){
                                        //Push it off the screen so people 
can't see it.
                                        $(this).css("position","absolute");
                                        $(this).css("left","-1000em");
//Make it visible to fix the WOFileUpload missing form data exception
                                        $(this).show();
                                });
                        });
                }
        });
</script>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to