aspose file tools
The moose likes Applets and the fly likes Reading a passed Object from Javascript in Applet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Applets
Reply Bookmark "Reading a passed Object from Javascript in Applet" Watch "Reading a passed Object from Javascript in Applet" New topic
Author

Reading a passed Object from Javascript in Applet

T Almo
Greenhorn

Joined: Sep 09, 2009
Posts: 10
Instead of using the applets File Dialog, I was hoping to use the standard <input type=file> to bring up the file dialog, then once the file is selected, pass it to the applet to do the upload. The problem with this (in Firefox 3) is that when I call the value in Javascript(ExtJS) with inputFile.dom.value, the browser removes the file path for security reasons, and I only get the filename. If I look at the inputFile.dom object in Firebug, I see that the value attribute contains the entire path.

Since the browser does the truncating upon the .value call, I was hoping I could just pass the entire dom object to the Applet, then read the value in the applet, which should contain the whole path. I've passed the object in by using ExtJS to dynamically set a parameter value to the dom object and use a getParameter() in the applet, but Im not really sure how to read it. The applet believes its an Object and when I do a println on it, it just outputs [object Object]. It should be a JSON object, I believe, but I dont have a good way of seeing whats in it on the applet side of things.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35239
    
    7
Doing a ".getClass().getName()" on it will tell you what kind of object it actually is.


Android appsImageJ pluginsJava web charts
T Almo
Greenhorn

Joined: Sep 09, 2009
Posts: 10
.getClass().getName() told me that its a String, so why does calling a println on it give me [object Object]? Ive tried setting the passed in parameter as a String as well (so the applet believes its a string) and that printed out the same object message.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Reading a passed Object from Javascript in Applet
 
Similar Threads
upload and download file to any machine in a n/w
Some General Questions.
can applet call javascript function?? HOW??
Passed
Passed SCEA Part 2 - My experience