PDA

View Full Version : [FIXED] proxy exception codes to undefined variable me



svenna
27 Feb 2012, 12:07 AM
When adding an exception even to a RestProxy the generated code refers an undefined variable: me.

ExtJs, Build 298



proxy: {
type: 'rest',
url: '../../webroot/rest/prosjektinfo',
reader: {
type: 'json',
root: 'results'
},
writer: {
type: 'json'
},
listeners: {
exception: {
fn: me.onRestproxyException,
Uncaught ReferenceError: me is not defined
scope: me
}
}
},

aconran
27 Feb 2012, 9:53 AM
Thanks for the bug report.

aconran
14 Mar 2012, 11:05 AM
svenna -

In the latest build, the reference is there. I believe we fixed this as part of the code generation/override fixes. Could you please confirm?

svenna
14 Mar 2012, 11:26 PM
Something changed, but not there yet..

There is a new code generated, no listeners is defined, only a function.
Also, the designer gives a red-exclamation error saying: "Invalid Configuration Click for details" => "A valid function must have fn set. In addition, a function of a non top level component must match a configuration"

Generated code, from build 311



Ext.define('EcoInteractive.model.Pumpe', {
extend: 'Ext.data.Model',
config: {
idProperty: 'Id',
proxy: {
type: 'rest',
url: '../webroot/rest/pumper/',
reader: {
type: 'json',
rootProperty: 'data'
},
writer: {
type: 'json',
writeAllFields: false
}
},
fields: [
{
name: 'Id',
type: 'int'
},
{
name: 'navn'
},
{
name: 'modell',
type: 'int'
},
{
name: 'modellnavn'
},
{
name: 'serienummer',
type: 'int'
},
{
name: 'cscu'
},
{
dateFormat: 'Y-m-d',
name: 'installert',
type: 'date'
},
{
name: 'status'
},
{
name: 'kunde',
type: 'int'
},
{
name: 'installertavstr'
}
]
},

onRestproxyException: function(server, response, operation, options) {
Ext.Msg.alert('Feil','Det oppstod en feil under kommunikasjon med serveren');
}

});

aconran
15 Mar 2012, 6:46 AM
In your last post, you mention 2 other bugs that I am aware of. The first regarding the error message which has since been solved and will be released with build 330 (coming within a week).

The 2nd bug is that in Touch the listeners is not set to link to the exception.

Your original post was a bug report for Ext JS though, is that one fixed?

svenna
16 Mar 2012, 12:49 AM
Obs, sorry.. Did a touch app release yesterday so I was all "touch" when replying. Yes, this is now fixed with ExtJs projects :)

Thanks

aconran
11 Apr 2012, 4:49 PM
Both of the above stated bugs are now resolved.