[CLOSED] Force Standard Submit

  1. #1

    [CLOSED] Force Standard Submit

    Hi,

    I have a main formpanel with some fields, and inside I have another formpanel with a fileupload field to perform an image upload.
    Inner formpanel submit works right with a file upload submit.

    But main formpanel submit sends a non standard submit to server too. I tried to disabled fileupload before submit, and force standard submit in main formpanel like a param of submit function

    DetailsForm.form.submit({
                        waitMsg: 'Message',
                        waitTitle: 'Title',
                        standardSubmit: true
                    });
    But it seems that formpanel deduces that have a fileupload an ignore it.

    Is there a way to force an standard submit with any property or config?

    I'm using Ext.NET 2.1 r4377.

    Thanks
    Last edited by Daniil; May 28, 2013 at 12:32 PM. Reason: [CLOSED]
  2. #2
    Well, seems that I avoid mainPanel use a multipart/form-data submit using this

    myFileUpload.isFileUpload = function () { return false; };
    This is what I want, is there an elegant way to do it? Or I must use this hack?
  3. #3
    Hi @softmachine2011,

    A parent FormPanel submits all its fields cascading down the hierarchy. So, its hasUpload method returns true if a form contains a FileUploadField at any level in depth. So, a parent FormPanel makes an upload request. It might be an omission in the design to nest FormPanels. Though, if you really need it, you hack looks fine.

    Please note that "standardSumit: true" makes a standard HTML form submit instead of a XHR (AJAX) request.
    http://docs.sencha.com/extjs/4.2.1/#...standardSubmit

    And that config works regardless a FileUploadField.

    This script
    App.FormPanel.form.submit({ standardSubmit: true });
    makes a standard HTML form submission of this FormPanel
    <ext:FormPanel ID="FormPanel1" runat="server" Url="submitUrl">
        <Items>
            <ext:FormPanel runat="server">
                <Items>
                    <ext:FileUploadField runat="server" />
                </Items>
            </ext:FormPanel>
        </Items>
    </ext:FormPanel>
    So, I think it works as expected.

    Probably, under a "standard submit" you mean an XHR (AJAX) submission, don't you? If so, as I said before it can't make such a request if a FormPanel contains a FileUploadField. Again, your hack looks fine.
  4. #4
    Yes, as you say, I mean an XHR (AJAX) request but with all rubbish that adds fileupload submit.
    When I say standard I expect a normal XHR AJAX submit.

    Thanks for clarify about my hack. You can close thread.

Similar Threads

  1. Replies: 1
    Last Post: Jul 25, 2012, 9:52 AM
  2. [CLOSED] Which accessibility standard supported by Ext.Net
    By leon_tang in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 11, 2012, 5:11 PM
  3. [CLOSED] Submit gridpanel data in form submit
    By jchau in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 14, 2010, 7:25 PM
  4. [CLOSED] Emulating a standard DropDownList
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Dec 05, 2009, 7:53 PM
  5. [CLOSED] CheckboxSelectionModel Checkall as Standard
    By macap in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Aug 05, 2009, 9:17 AM

Tags for this Thread

Posting Permissions