I try upload an file in a form using ExtJS 4.1.1
The upload is sucess but the response is not bean reader. I get the follow error in firebug:
PHP Code:
TypeErrorresult is undefinedif (result !== true && !result.success) { 
The error is on the file src/form/action/Submit.js on line 221

But the server is getting the file and sending the apropriated response:

{"success": true}

If I remove the filefield from the form, I get the correct behavior. I'm returning a simple json {success: true}
The Ext code is:

Code:
/**
 * Criado por Giovanni Candido <giovanni@atende.info>
 * Date: 22/08/12
 * Time: 11:51
 */
//define o conteudo de abrir chamado (interface)

var required = '<span style="color:red;font-weight:bold" data-qtip="Required">*</span>';

Ext.define('CH.view.menu.AbrirChamado',{
    extend: 'Ext.panel.Panel',
    alias: 'widget.abrirChamado',
    border:false,
    layout: {
        type: 'hbox',
        pack: 'center',
        align: 'middle'
    },
    items:[{
        xtype: 'form',
        url: '/chamado/',
        title:'Abrir Chamado' ,
        width: 500,
        height: 350,
        layout: 'form',
        defaultType: 'textfield',
        bodyPadding: 20,
        items: [
            {
                fieldLabel: 'Solicitante',
                name: 'solicitante',
                afterLabelTextTpl: required,
                allowBlank: false
            },{
                fieldLabel: 'E-mail',
                name: 'email'  ,
                afterLabelTextTpl: required,
                allowBlank: false,
                vtype: 'email',
                maxLength: 120
            }, {
                xtype:'combo',
                fieldLabel:'Departamento',
                name: 'departamento',
                afterLabelTextTpl: required,
                allowBlank:false,
                store: 'Departamentos',
                displayField: 'nome',
                editable: false


            },{
                fieldLabel:'Prédio',
                xtype: 'numberfield',
                allowBlank: false,
                afterLabelTextTpl: required,
                name:'predio',
                minLength: 1,
                maxLength: 2
            },{
                fieldLabel:'Sala',
                name:'sala',
                maxLength: 30,
                allowBlank: false,
                afterLabelTextTpl: required
            },{
                fieldLabel:'Ramal',
                xtype: 'numberfield',
                name:'ramal',
                afterLabelTextTpl: required,
                allowBlank: false,
                minLength: 4,
                maxLength: 4
            },{
                xtype: 'filefield',
                name: 'arquivo',
                fieldLabel: 'Arquivo'
            },{
                xtype:'textarea',
                fieldLabel:'Descrição',
                name:'descricao',
                afterLabelTextTpl: required,
                allowBlank: false,
                maxLength: 255,
                enforceMaxLength: true
            }],
        buttons: [{
            text: 'Reset',
            handler: function() {
                this.up('form').getForm().reset();
            }
        }, {
            text: 'Submit',
            formBind: true,
            disabled: true,
            handler: function() {
                var form = this.up('form').getForm();
                if(form.isValid()){
                    form.submit({
                        waitMsg: 'Uploading your photo...',
                        success: function(fp, o) {
                            msg('Success', 'Processed file "' + o.result.file + '" on the server');
                        }
                    });
                }
            }
        }]
        }]
})
The server is Spring Framework and the controller is:

Code:
@RequestMapping(value = "/chamado", method = RequestMethod.POST)
    public @ResponseBody ExtResponse abrirChamado(@RequestParam String solicitante,
                                                  @RequestParam String email,
                                                  @RequestParam String departamento,
                                                  @RequestParam String predio,
                                                  @RequestParam String sala,
                                                  @RequestParam String descricao,
                                                  @RequestParam String ramal,
                                                  @RequestParam MultipartFile arquivo){
        String mensagemRetorno = "";
        Chamado chamado = new Chamado();
        chamado.setNomeSolicitante(solicitante);
        chamado.setEmailSolicitante(email);
        chamado.setDepartamento(departamento);
        chamado.setPredio(predio);
        chamado.setSala(sala);
        chamado.setDescricao(descricao);
        chamado.setRamal(ramal);
        if(!arquivo.isEmpty()){
            byte[] bytes;
            try {
                bytes = arquivo.getBytes();
                chamado.setArquivo(bytes);
            } catch (IOException e) {
                mensagemRetorno += " Arquivo não pode ser anexado em chamado";
            }

        }
        dao.salvar(chamado);
        return ExtResponse.SUCCESS;
    }