[CLOSED] HttpWriteProxy sending parameters in querystring

  1. #1

    [CLOSED] HttpWriteProxy sending parameters in querystring

    Hi guys, i'm having some trouble with the HttpWriteProxy.
    I have set it to use the method POST.

    But when i save the store, the store data is sent via the querystring instead in the request body.

    Any help about this?

    This is my code:
            <ext:Store ID="storeEventos" runat="server">
                <Reader>
                    <ext:JsonReader IDProperty="IdTelecontrolEvento">
                        <Fields>
                        <ext:RecordField Name="IdTelecontrolEvento" Type="Int" />
                        <ext:RecordField Name="IdEventoAnterior" Type="Int" />
                        <ext:RecordField Name="IdVariante" Type="Int" />
                        <ext:RecordField Name="VarianteNombre" Type="String" />
                        <ext:RecordField Name="IdMaterial" Type="Int" />
                        <ext:RecordField Name="MaterialNombre" Type="String" />
                        <ext:RecordField Name="IdTipoEventoTelecontrol" Type="Int" />
                        <ext:RecordField Name="TipoEventoTelecontrolNombre" Type="String" />
                        <ext:RecordField Name="IdProducto" Type="Int" />
                        <ext:RecordField Name="ProductoNombre" Type="String" />
                        <ext:RecordField Name="IdAnunciante" Type="Int" />
                        <ext:RecordField Name="AnuncianteNombre" Type="String" />
                        <ext:RecordField Name="IdTipoAviso" Type="Int" />
                        <ext:RecordField Name="TipoAvisoNombre" Type="String" />
                        <ext:RecordField Name="IdCategoriaPNT" Type="Int" />
                        <ext:RecordField Name="CategoriaPNTNombre" Type="String" />
                        <ext:RecordField Name="IdResultadoTelecontrol" Type="Int" />
                        <ext:RecordField Name="ResultadoTelecontrolNombre" Type="String" />
                        <ext:RecordField Name="Duracion" Type="Int" />
                        <ext:RecordField Name="HoraEmision" Type="String" />
                        <ext:RecordField Name="Observaciones" Type="String" />
                        <ext:RecordField Name="Multiple" IsComplex="true"  />
                        </Fields>
                    </ext:JsonReader>
    
                </Reader>
                <UpdateProxy>
                    <ext:HttpWriteProxy Json="true" Url="TelecontrolHandler.ashx?Operation=CreateEventos"  Method="POST">
                    </ext:HttpWriteProxy>
                </UpdateProxy>
            </ext:Store>
    And this is the function that executes the save in the store:
            var evento = self.hydrate();
            self.clear();
    
            self.Stores.Eventos.addRecord(evento, false);
            if (autoCommit) {
                self.Stores.Eventos.save();
            }
    Last edited by Baidaly; Nov 01, 2013 at 9:53 PM. Reason: [CLOSED]
  2. #2
    Hi @tlfdesarrollo,

    Thank you for the report.

    Please try the following fix (add into the page's <head>).

    Fix
    <ext:ResourcePlaceHolder runat="server" Mode="ScriptFiles" />
    
    <script type="text/javascript">
        Ext.net.HttpWriteProxy.override({
            save : function (params, reader, callback, scope, arg) {
                if (this.fireEvent("beforesave", this, params) !== false) {
                    var o = {
                        params   : params || {},
                        request  : {
                            callback : callback,
                            scope    : scope,
                            arg      : arg
                        },
                        reader   : reader,
                        scope    : this,
                        callback : this.saveResponse
                    };
                
                    if (this.conn.json) {
                        o.jsonData = params;
                        delete o.params; // fix
                    }
                
                    if (this.useAjax) {
                        Ext.applyIf(o, this.conn);
                        o.url = this.conn.url;
                    
                        if (this.activeRequest) {
                            Ext.Ajax.abort(this.activeRequest);
                        }
    
                        this.activeRequest = Ext.Ajax.request(o);
                    } else {
                        this.conn.request(o);
                    }
                } else {
                    callback.call(scope || this, null, arg, false);
                }
            }
        });
    </script>
  3. #3
    Thanks Daniil, it worked like a charm! =)

Similar Threads

  1. DropdownField value is not sending
    By inf2k in forum 2.x Help
    Replies: 2
    Last Post: Apr 06, 2014, 2:21 PM
  2. Replies: 6
    Last Post: Sep 24, 2013, 6:55 AM
  3. Replies: 2
    Last Post: Mar 12, 2013, 9:56 AM
  4. Replies: 4
    Last Post: Sep 08, 2011, 5:56 PM
  5. HttpWriteProxy help with WebService parameters
    By niceguymattx in forum 1.x Help
    Replies: 0
    Last Post: May 18, 2010, 9:28 AM

Posting Permissions