PDA

View Full Version : Tabpanel Validation



Petrotechics UI
28 Jan 2011, 1:29 AM
Greetings to the forum

I am using an Ext FormPanel and inside this I have xtype:'tabpanel' (stripped out code below). The tab panel has two tabs, both of these tabs has form fields with validation (see attached screenshot), my question is when the user hits submit and has not completed the mandatory fields on the second tab - can we bring this tab into focus? Perhaps I am doing something very wrong - and I would appreciate any advice on offer on how to correct this issue.

Thanks in advance

-Gs


this.form = new Ext.FormPanel({
items:[
{
layout:'column',
items:[
{
columnWidth:.5,
items:[
{
fieldLabel: Username
allowBlank: false
},
{
fieldLabel: Firstname,
allowBlank: false
}
]
},
{
columnWidth:.5,
items:[
{
fieldLabel: Job Title
},
{
fieldLabel: Surname,
allowBlank: false
}
]
}
]
},
{
xtype:'tabpanel',
plain:true,
activeTab:0,
height:200,
items:[
{
title:System Details,
layout:'column',
items:[
{
columnWidth:.5,
layout:'form',
items:[
{
xtype:'textfield',
fieldLabel: E-mail
},
this.combo
]
},
{
columnWidth:.5,
layout:'form',
border:false,
defaultType: 'textfield',
items:[
{
fieldLabel: Password,
allowBlank: this.mode == properties.editUserActionValue ? true : false
},
{
fieldLabel: Confrim Password,
allowBlank: this.mode == properties.editUserActionValue ? true : false
}
]
}
]
},
{
title:properties.createTitleManageRoles,
layout:'form',
//layoutOnTabChange:true,
items:[
this.roleCombo,
this.checkboxgroup
]
}
]
}
]
});

Petrotechics UI
28 Jan 2011, 2:53 AM
Sorry

School boy error, I had not searched the forum for previous similar issues (i have to get out of the habbit of just using google to search everywhere) anyway as said i have found a similar post which worked well for me.

http://www.sencha.com/forum/showthread.php?54700-Help-Setting-Active-Tab-On-Invalid-Validation&highlight=tabpanel+validation

Thanks

-Gs