Opened 12 years ago

Closed 11 years ago

#5755 closed defect (invalid)

Form submit doesn't work after dojo.io.iframe.send

Reported by: guest Owned by: anonymous
Priority: high Milestone: future
Component: General Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by dylan)

I use the send function like this :

dojo.io.iframe.send({url: 'x.do?method=setVal,

form: document.forms[0], handleAs: "application/json",

...

The send function of dojo.io.iframe call _fireNextRequest. This function ends with the foolowing instruction :

fn.target = this._iframeName;

This means that the target of the form passed to the send() function is overwritten each time I call the send function.

The result is that any call to the submit function of the form will be redirected to the hidden IFrame.

Change History (5)

comment:1 Changed 12 years ago by James Burke

Resolution: invalid
Status: newclosed

The goal of dojo.io.iframe.send() is to send requests to the server (normally involving input type=file fields) without showing any UI, so it uses a hidden frame to do the work.

Normally, your app logic should be catching all submit actions, and deciding whether to call dojo.io.iframe.send() or to do a different path. If using a different path, then your app code can set the target before following that path.

I'm going to close this for now as working as designed, but feel free to reopen if you can provide more information on why this behavior is a problem.

comment:2 in reply to:  1 ; Changed 12 years ago by guest

Resolution: invalid
Status: closedreopened

I don't agree with you, my page is composed of two parts :

  • a classic one with text inputs
  • a specific with file upload

I use dojo.io.iframe.send to send the files contents immediatly without waiting the user general submit on the page. Then after each use of dojo.io.iframe.send I have to reset the main form target...

Ektor

Replying to jburke:

The goal of dojo.io.iframe.send() is to send requests to the server (normally involving input type=file fields) without showing any UI, so it uses a hidden frame to do the work.

Normally, your app logic should be catching all submit actions, and deciding whether to call dojo.io.iframe.send() or to do a different path. If using a different path, then your app code can set the target before following that path.

I'm going to close this for now as working as designed, but feel free to reopen if you can provide more information on why this behavior is a problem.

comment:3 Changed 11 years ago by dylan

Milestone: 1.2

comment:4 Changed 11 years ago by dylan

Description: modified (diff)
Milestone: 1.2future

comment:5 in reply to:  2 Changed 11 years ago by Tom Trenka

Resolution: invalid
Status: reopenedclosed

Replying to guest:

This sounds to me like an application architecture issue and not an issue with the iframe API. The target and single iframe usage is by design; given those constraints, I would suggest that changing the target with each form submit seems like the solution for your specific problem.

Closing this out as jburke did.

I don't agree with you, my page is composed of two parts :

  • a classic one with text inputs
  • a specific with file upload

I use dojo.io.iframe.send to send the files contents immediatly without waiting the user general submit on the page. Then after each use of dojo.io.iframe.send I have to reset the main form target...

Ektor

Replying to jburke:

The goal of dojo.io.iframe.send() is to send requests to the server (normally involving input type=file fields) without showing any UI, so it uses a hidden frame to do the work.

Normally, your app logic should be catching all submit actions, and deciding whether to call dojo.io.iframe.send() or to do a different path. If using a different path, then your app code can set the target before following that path.

I'm going to close this for now as working as designed, but feel free to reopen if you can provide more information on why this behavior is a problem.

Note: See TracTickets for help on using tickets.