Hello!
First of all, thanks for creating this server stack for ASP.NET MVC, it's been very helpful!
I have a newbie question, but let's go. I'm simply trying to submit a Form that's inside a Window, calling a Register method o the Controller. But when I click the submit button, a JS exception is thrown, it doesn't even reach the controller. (Btw, 'get' operations works fine, like in the example project). Below is the code I'm currently using and the exception.
ExtJS Window:
Code:
Ext.namespace("MPD.UI");
CadastrarVoluntarios = Ext.extend(Ext.Window,
{
constructor: function(config)
{
config = Ext.apply({
id: 'window-cadastrarvoluntarios',
closeAction: 'hide',
collapsible: true,
closable: true,
resizable: false,
title: 'Cadastrar Voluntários',
border: false,
height: 300,
width: 500,
items: [{
xtype: 'form',
id: 'form-cadastrarvoluntarios',
labelWidth: 75,
items: [{
xtype: 'fieldset',
defaultType: 'textfield',
items: [{
fieldLabel: 'Nome',
name: 'nome',
allowBlank: false
}, {
fieldLabel: 'Endereço',
name: 'endereco',
allowBlank: false
}, {
fieldLabel: 'E-mail',
name: 'email',
vtype: 'email'
}, {
fieldLabel: 'Telefone',
name: 'telefone'
}, {
fieldLabel: 'Celular',
name: 'celular'
}]
}],
buttons:
[{
text: 'Cadastrar',
type: 'submit',
handler: function()
{
this.ownerCt.ownerCt.getForm().submit({
params: {
nome: 'nome',
endereco: 'endereco',
telefone: 'telefone',
celular: 'celular',
email: 'email'
}
});
}
}]
}],
api:
{
submit: Voluntarios.Cadastrar
},
paramOrder: ['nome','endereco', 'telefone', 'celular', 'email']
}, config);
CadastrarVoluntarios.superclass.constructor.call(this, config);
},
parent: null,
init: function(parent)
{
this.parent = parent;
parent.cadastrarVoluntarios = this;
}
});
Controller:
Code:
namespace MaisPertoDeDeus.Controllers
{
public class VoluntariosController : Controller
{
[FormHandler]
public ActionResult Cadastrar(string nome, string endereco, int telefone, int celular, string email)
{
return this.Direct(null);
}
}
}
Any help is appreciated. Thanks in advance!