getParameter just returns null

Upload core product.
Post Reply
Chris78
Posts: 22
Joined: Fri Aug 15, 2008 9:51 am

getParameter just returns null

Post by Chris78 »

Hi there!

I'd like to use getParameter, which seems to be a valid function of the applet, but it returns null when I call it.

I'm using document.clientupload_box.setParameter('ids','1,2,3') to have the applet send along these IDs when I upload files. But getParameter('ids') does return null after that.

The applet will still send the parameter to the server, but I need a way to check them and read them via getParameters.

The actual reason for all this is, that setParameter will fail if you call it immediately after toggeling the containing div from hidden to visible.

Imagine a DIV element that contains the applet, and which has style "display:none;".

If you do the following:
div.show();
document.clientupload_box.setParameter('ids','1,2,3')

the applet will NOT submit the above values to the server. If I call setParameter() manually after the div.show(), it will work fine.

Any ideas or suggestions about that? Any way to check if the applet is responsive and ready to process the setParameter() call?

Thanks in advance!
Chris

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: getParameter just returns null

Post by support »

Yes, getParameter doesn't work, you need JSAPI add-on with :
document.fileupload.getRegularParameter(name);
or:
document.fileupload.getExtraParameter(name);

JSAPI add-on:
http://www.jfileupload.com/products/tools/index.html

Does it help ?

Chris78
Posts: 22
Joined: Fri Aug 15, 2008 9:51 am

Re: getParameter just returns null

Post by Chris78 »

Hi!

I will keep that in mind and try later.

For now I found out that using the style visibility:hidden setParameter will work. I guess if an html-element with an applet inside uses display:none, the browser will re-initialize the applet when you display the element again and previously set parameters get lost. By just toggling the visibility style this won't happen.
So actually I don't need getParameter as workaround anymore now.

Thanks!
Chris

PS: The JSAPI seems to be a real powerful tool. I think I speak for many others when encouraging you to add some more detailed documentation about it. ;)

Post Reply