I'm creating and showing a window like such:
var w = Ext.widget('EditPortalUserWindow');
w.show();
In the view, this is how the window and its child components are defined:
Ext.define('Customer_Portal_UI.view.MainContent.EditPortalUserWindow', {
alias: 'widget.EditPortalUserWindow',
extend: 'Ext.Window',
height: 400,
width: 500,
modal: true,
resizable: false,
items: [
{
xtype: 'form',
frame: false,
bodyStyle: 'background-color:white;border-width: 0px;',
itemId: 'EditPortalUserForm',
trackResetOnLoad: true,
url: GlobalVars.portalUserPostApiUrl,
method: 'POST',
items: [
{
xtype: 'tabpanel',
items: [
{
xtype: 'panel',
itemId: 'GeneralInfoFieldsetPanel',
title: 'General',
items: [Ext.widget('GeneralInfoFieldset')]
},
{
xtype: 'panel',
itemId: 'UserRolesGridPanel',
title: 'Portal roles',
items: [Ext.widget('UserRolesGridFieldSet')]
}
]
}
]
}
]
});
Ext.define('Customer_Portal_UI.view.MainContent.GeneralInfoFieldset', {
extend: 'Ext.form.FieldSet',
alias: 'widget.GeneralInfoFieldset',
columnWidth: 0.5,
style: 'padding: 20px;',
bodyStyle: 'border-width: 0px;background-color:white;',
defaults: {
anchor: '100%'
},
items: [
{
xtype: 'textfield',
fieldLabel: 'User ID',
name: 'UserID'
},
{
xtype: 'textfield',
fieldLabel: 'Username',
name: 'UserName'
},
{
xtype: 'textfield',
fieldLabel: 'Password',
name: 'password'
},
{
xtype: 'textfield',
fieldLabel: 'Confirm password',
name: 'confirmPassword'
},
{
xtype: 'textfield',
fieldLabel: 'Full name',
name: 'FullName'
},
{
xtype: 'textfield',
fieldLabel: 'Email Address',
name: 'EmailAddress'
}
]
});
Ext.define('Customer_Portal_UI.view.MainContent.PortalUser.AvailRolesGrid', {
alias: 'widget.AvailRolesGrid',
itemId: 'AvailRolesGrid',
title: 'Available roles',
extend: 'Ext.grid.Panel',
width: 150,
height: 150,
hideHeaders: true,
store: 'portalRoleStore',
columns: [
{ dataIndex: 'RoleDisplayName', flex: 1 }
]
});
Ext.define('SelectedRolesGrid', {
alias: 'widget.SelectedRolesGrid',
itemId: 'SelectedRolesGrid',
title: 'Selected roles',
extend: 'Ext.grid.Panel',
width: 150,
height: 150,
hideHeaders: true,
store: 'selectedPortalRoleStore',
columns: [
{ dataIndex: 'RoleDisplayName', flex: 1 }
]
});
Ext.define('Customer_Portal_UI.view.MainContent.UserRolesGridFieldSet', {
extend: 'Ext.form.FieldSet',
alias: 'widget.UserRolesGridFieldSet',
layout: 'hbox',
items: [Ext.widget('SelectedRolesGrid'), Ext.widget('AvailRolesGrid')]
});
The window is created and shown OK the first time, but the 2nd time, I'm getting two different errors for each of the tabs that I'm creating within the window's tabpanel.
If I comment them out (obviously, the window holds nothing) I don't get the error and I open and close the window as I please without errors.
Do you guys see any obvious misuse or blatant mistakes about how I create the window and its components ?
All the Ext.define
calls are done within the initComponent()
method of the associated view.
The window's default close action is destroy
so I'm wondering if the tabs are not recreated properly even though I would think so as when I'm creating the window, I'm asking for everything to be recreated.
Thank you.