Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading a passed Object from Javascript in Applet

 
T Almo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doing a ".getClass().getName()" on it will tell you what kind of object it actually is.
 
T Almo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic