PDA

View Full Version : Panel instead of FormPanel



raj_plays
2 Feb 2010, 12:00 AM
Hi,
I wanted to place a FormPanel on my page which is an aspx but since the page derives from a master page that has a form in it, I had to place a Panel instead.
Now, I am unable to submit the form. Here is my code...

var form = { xtype: 'panel', id: 'login-form', layout: 'form',
bodyStyle: 'padding:15px; background:transparent', border: false,
url:'ReportService.asmx/get',
items:
[
{ xtype: 'textfield', id: 'login-user', fieldLabel: 'Username', allowBlank: false }
],
buttons:
[
{ text: 'Login', handler: function() {Ext.getCmp('login-form').getForm().submit();}},
{ text: 'Cancel', handler: function() {win.hide();}}
]
};

var win = new Ext.Window({
layout: 'form', width: 340, autoHeight: true, closeAction: 'hide',
items: [form],
renderTo: 'formDiv'
});

win.show();

What should be correct login handler do?
Please help.

realjax
2 Feb 2010, 12:05 AM
remove layout: 'form' from your Window config,replace it with layout: 'fit 'and change the xtype in your form var to a 'form'

raj_plays
2 Feb 2010, 2:45 AM
Thanks for your time realjax but your solution didn't work. It gives a runtime error.
The problem is that because my aspx has a master page, there is already a form on the page and we are attempting to place another form in it.