Ticket #5755 (closed defect: invalid)

Opened 6 months ago

Last modified 3 weeks ago

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

Reported by: guest Owned by: anonymous
Priority: normal Milestone: future
Component: General Version: 1.0
Severity: normal Keywords:
Cc:

Description (last modified by dylan) (diff)

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

follow-up: ↓ 2   Changed 6 months ago by jburke

  • status changed from new to closed
  • resolution set to invalid

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.

in reply to: ↑ 1 ; follow-up: ↓ 5   Changed 5 months ago by guest

  • status changed from closed to reopened
  • resolution deleted

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.

  Changed 5 months ago by dylan

  • milestone set to 1.2

  Changed 3 weeks ago by dylan

  • description modified (diff)
  • milestone changed from 1.2 to future

in reply to: ↑ 2   Changed 3 weeks ago by ttrenka

  • status changed from reopened to closed
  • resolution set to invalid

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.