PDA

View Full Version : [FIXED] Architect does not warn you when selecting an alias which already exists in framework



jim@carroll.net
7 Aug 2012, 4:28 AM
I'm not sure whether this belongs in the Architect forum or the extjs4 forum. But because the seeing the problem requires Architect, I thought I'd post here.

Created a very simple 5-panel app, with a single button. Clicking button pops up a MessageBox.

The apps works against extjs 4.0.7, but displays a blank page in 4.1.1 using FireFix 14 and IE9. NOTE: If you run FF with Firebug, it get's caught in infinite loop & FF has to be killed.

Attached are two archived versions of the project. Broken.xda and Working.xda. The only change between the two is the ExtJS path.

The way we set the ExtJS was "Settings => Project", and set the ExtJS path to:

WORKS: http://extjs.cachefly.net/ext-4.0.7-commercial/

FAILS: http://extjs.cachefly.net/ext-4.1.1-commercial/


NOTE: The only thing we did "different" with this app was we created several top level views and LINKED them against the ViewPort. This was our first attempt to follow the best practice recommendations as described in http://www.sencha.com/learn/architecting-your-app-in-ext-js-4-part-1/.

Followed the advice described in the forum article http://www.sencha.com/forum/showthread.php?235689-Question-about-MVC-design-patterns-separate-view-components-as-building-blocks.

Help?!

evant
7 Aug 2012, 1:46 PM
The problems are on your side, in fact the dev version gives you warnings about it:

1) Override Ext.panel.Header alias with your own header alias.
2) Used alias 'widget.bottom' twice.

3) Though these aren't really a cause of any problem, they're redundant configs.
a) Width/height are invalid on center region.
b) Width invalid on top/bottom region.

Updated code:


Ext.require('*');

Ext.define('SeperateViews1.view.Center', {
extend: 'Ext.panel.Panel',
alias: 'widget.myheader',

initComponent: function() {
var me = this;

Ext.applyIf(me, {
items: [{
xtype: 'button',
text: 'MyButton'
}]
});

me.callParent(arguments);
}
});

Ext.define('SeperateViews1.view.Left', {
extend: 'Ext.panel.Panel',
alias: 'widget.center',

width: 150,

initComponent: function() {
var me = this;

me.callParent(arguments);
}
});

Ext.define('SeperateViews1.view.Right', {
extend: 'Ext.panel.Panel',
alias: 'widget.left',

width: 150,

initComponent: function() {
var me = this;

me.callParent(arguments);
}
});

Ext.define('SeperateViews1.view.Top', {
extend: 'Ext.panel.Panel',
alias: 'widget.top',

height: 250,

initComponent: function() {
var me = this;

me.callParent(arguments);
}
});

Ext.define('SeperateViews1.view.Bottom', {
extend: 'Ext.panel.Panel',
alias: 'widget.bottom',

height: 250,
title: 'My Panel',

initComponent: function() {
var me = this;

me.callParent(arguments);
}
});

Ext.define('SeperateViews1.view.MainVP', {
extend: 'Ext.container.Viewport',

layout: {
type: 'border'
},

initComponent: function() {
var me = this;

Ext.applyIf(me, {
items: [{
xtype: 'myheader',
title: 'Center',
region: 'center'
}, {
xtype: 'center',
title: 'Left',
region: 'west'
}, {
xtype: 'left',
title: 'Right',
region: 'east'
}, {
xtype: 'top',
height: 75,
preventHeader: true,
title: 'Top',
region: 'north'
}, {
xtype: 'bottom',
height: 75,
title: 'Bottom',
region: 'south'
}]
});

me.callParent(arguments);
}
});

Ext.onReady(function() {
new SeperateViews1.view.MainVP();
});

aconran
7 Aug 2012, 2:22 PM
I will file a bug for Architect as it should be warning you when you choose a userAlias which collides with an existing one.

dfoelber
17 Aug 2012, 7:11 AM
Hi,

Architect will give a warning when your userAlias configs collide in the next update. Thanks for your feedback!

jim@carroll.net
17 Aug 2012, 7:29 AM
Thanks much B)