You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by nuria <nu...@hotmail.com> on 2008/06/10 17:40:05 UTC

ajax file upload in iframe

Hi all,
I have this problem: the result of form submission (with s:file) is Object
HTMLDocument] in firefox and [object] in IE7 in my s:div.  I have been
looking to have the action response in my div and not in the iframe DOJO is
creating. I am working with struts 2.0.11.1. i thing solution has been
resolved in version 2.1.
Is there any other way to submit the form and redirect the action response
to my div??
I have tried with: (Is not working to me, is there any error???)

dojo.require("dojo.io.IframeIO");
	
	function sendIt(){
	
	
   var bindArgs = {
       transport: "IframeTransport",
       formNode: document.getElementById("nouInforme"),
       mimetype: "text/plain",
       load: function(type, data, evt){
           document.getElementById("aplicacion").innerHTML =
data.firstChild.innerHTML;
       }
   };
   	var request = dojo.io.bind(bindArgs);
   	
}


-- 
View this message in context: http://www.nabble.com/ajax-file-upload-in-iframe-tp17758498p17758498.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ajax file upload in iframe

Posted by Martin <mg...@hotmail.com>.
Nuria-

If you load the Page (with Javascript) in firefox with firebug turned on
Look at all messages displayed in console
Look at Javascript js files to ensure all have been properly loaded

We'll need to see your JSP form
(specifically the tag attributes specifically called..)
nouInforme
aplicacion

please make sure you have these JS files located in struts-webapp folder
%TOMCAT_HOME%/webapps/struts2-webapp/dojo/io/*.*

if you dont have them located there you can copy from the dojo source 
libraries located at
%DOJO_HOME%/struts/static/dojo/src/io/*.*

Merci/Thanks
Martin
----- Original Message ----- 
From: "nuria" <nu...@hotmail.com>
To: <us...@struts.apache.org>
Sent: Tuesday, June 10, 2008 11:40 AM
Subject: ajax file upload in iframe


>
> Hi all,
> I have this problem: the result of form submission (with s:file) is Object
> HTMLDocument] in firefox and [object] in IE7 in my s:div.  I have been
> looking to have the action response in my div and not in the iframe DOJO 
> is
> creating. I am working with struts 2.0.11.1. i thing solution has been
> resolved in version 2.1.
> Is there any other way to submit the form and redirect the action response
> to my div??
> I have tried with: (Is not working to me, is there any error???)
>
> dojo.require("dojo.io.IframeIO");
>
> function sendIt(){
>
>
>   var bindArgs = {
>       transport: "IframeTransport",
>       formNode: document.getElementById("nouInforme"),
>       mimetype: "text/plain",
>       load: function(type, data, evt){
>           document.getElementById("aplicacion").innerHTML =
> data.firstChild.innerHTML;
>       }
>   };
>   var request = dojo.io.bind(bindArgs);
>
> }
>
>
> Thanks..
>
> -- 
> View this message in context: 
> http://www.nabble.com/ajax-file-upload-in-iframe-tp17758498p17758498.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ajax file upload in iframe

Posted by nuria <nu...@hotmail.com>.
Martin thanks for your replay,
I know it could be a simple error for you but I am new in ajax, struts... 
"nouInforme" is the form created in the jsp loaded in di "aplicacion". Once
submited I want the response in the same div "aplicacion". Them are there.
The library is in the correct place.
The firebug console is given an error: (but I have not idea if is other kind
of error):
event has no properties
 fixEvent(undefined)common.js (line 54)
 handleEvent(undefined)common.js (line 39)
 initz()()wz_dragdrop.js (line 391)
[Break on this error] event.preventDefault = fixEvent.preventDefault;

-- 
View this message in context: http://www.nabble.com/ajax-file-upload-in-iframe-tp17758498p17776093.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org