Success! Looks like we've fixed this one. According to our records the fix was applied for DSGNR-2265 in a recent build.
  1. #1
    Touch Premium Member svenna's Avatar
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    407
    Vote Rating
    18
    svenna will become famous soon enough svenna will become famous soon enough

      0  

    Default Unable to define exception event on RestProxy - me not defined

    Unable to define exception event on RestProxy - me not defined


    ExtJs 4.1, Architect 2.1

    I reported the same issue before, as bug DSGNR-1457
    http://www.sencha.com/forum/showthre...ghlight=Svenna

    Back then it was with build 298. It seems like the bug has returned, or that my confirmation of the fix was incorrect.

    This code gives an exception of "me is not defined"

    Code:
    Ext.define('BRes.model.Pulje', {
        extend: 'Ext.data.Model',
    
        idProperty: 'Id',
    
        proxy: {
            type: 'rest',
            url: 'http://d-box.sventore.com/dev/bowlingres.no/webroot/rest/puljer/',
            reader: {
                type: 'json',
                root: 'results'
            },
            writer: {
                type: 'json',
                writeAllFields: false
            },
            listeners: {
                exception: {
                    fn: me.onRestproxyException,
                    scope: me
                }
            }
        },
    
        fields: [
            {
                name: 'Id',
                type: 'int'
            },
            {
                name: 'puljesegment',
                type: 'int'
            },
            {
                dateFormat: 'Y-m-d H:i:s',
                name: 'start',
                type: 'date'
            },
            {
                name: 'plasser',
                type: 'int'
            },
            {
                name: 'segmentnavn'
            },
            {
                name: 'startstr',
                persist: false
            },
            {
                name: 'antalldeltagere',
                persist: false,
                type: 'int'
            }
        ],
    
        onRestproxyException: function(server, response, operation, options) {
            console.log(server,response,operation,options);
        }
    
    });
    Sven Tore Iversen

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,883
    Vote Rating
    102
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Hrm, we don't allow users to put in event handlers for a proxy when it is associated with a model.

    Could you provide steps for how you were able to create this?
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Touch Premium Member svenna's Avatar
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    407
    Vote Rating
    18
    svenna will become famous soon enough svenna will become famous soon enough

      0  

    Default


    Hum..

    Create Model, Add Proxy to model, then on the proxy click "Event Bindings" + icon.
    The drop-down appearing only have the one option: 'exception'.

    I've done it like this since the "Event Bindings" option was added.

    However I can also drag the Basic Event Binding over to the proxy.

    If this is not supposed to work. How am I supposed to catch server error messages for the REST proxy? And how should it be done within Architect? - except with an override. In my case overriding all rest proxies would be an option.


    Image attached

    Capture.JPG
    Sven Tore Iversen

  4. #4
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,883
    Vote Rating
    102
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Okay, so first off I agree that there is a bug (or possibly several rolled into one) with this.

    Quote Originally Posted by svenna View Post
    However I can also drag the Basic Event Binding over to the proxy.
    I cannot reproduce this. I created a model. I added a RestProxy to the model. I cannot drag/drop a basic event binding and or create via "Event Bindings" in the property grid.

    Quote Originally Posted by svenna View Post
    If this is not supposed to work. How am I supposed to catch server error messages for the REST proxy? And how should it be done within Architect?
    We probably need to change this so that the proxy is constructed within the constructor of the model similar to how we do stores.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  5. #5
    Touch Premium Member svenna's Avatar
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    407
    Vote Rating
    18
    svenna will become famous soon enough svenna will become famous soon enough

      0  

    Default


    I've done this in more than one project, I can email you the project I'm working on now, just need a preferred address.
    Sven Tore Iversen

  6. #6
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,883
    Vote Rating
    102
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    aaron at sencha
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  7. #7
    Sencha User
    Join Date
    Nov 2011
    Posts
    10
    Vote Rating
    0
    blum@wapa.gov is on a distinguished road

      0  

    Default Workaround

    Workaround


    I know this thread is a bit old but there is an easy workaround - just add 'listeners' as a Custom property to the proxy. In my case that looks like this as shown in the Architect editor:

    Code:
    listeners - object <-- editor box header
    // NOTE - this code added as a custom property to the Proxy, not via 'Event Bindings'
    // When added as an event the listener function call attempts to use a 'me' reference
    // & proxies have no 'me'.
    {
        exception: {
            fn: function(pxy, response, operation, options){
                WhatEver();
            }
        }
    }

  8. #8
    Touch Premium Member svenna's Avatar
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    407
    Vote Rating
    18
    svenna will become famous soon enough svenna will become famous soon enough

      0  

    Default


    Thanks for the Tip. after e-mailing with Aron he found that in my project, that was created before Architedt disabled exceptions I could add exceptions to a model proxy, but not when creating a new project.

    Aron commented that they would likely allow it again new relases. Since I'm still working on the same projects I havent noticed it there is a change yet.
    Sven Tore Iversen

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar