Soy nuevo en esta libreria y estoy utilizandola para mi Proyecto de Fin de Carrera, pero aunque me lo he estado empollando por mi cuenta me he atascado en los submit de los formularios... Quiero que se ejecute un servlet de java simple un "hola mundo" pero no soy capaz de conseguirlo.
En este link esta el formulario de donde quiero lanzar el servlet al pulsar en el botón Enviar
http://pantuflo.escet.urjc.es/~jgonzale ... iones.html
Y el código de mi js esta extraido de los ejemplos de la web de extjs (el principio es solo paja para diseñar la interfaz):
- Código: Seleccionar todo
/*
* Ext JS Library 2.0 RC 1
* Copyright(c) 2006-2007, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.onReady(function(){
Ext.QuickTips.init();
function showResult(btn){
Ext.example.msg('Button Click', 'You clicked the {0} button', btn);
};
function showResultText(btn, text){
Ext.example.msg('Button Click', 'You clicked the {0} button and entered the text "{1}".', btn, text);
};
/* Datos para la creación del grid */
var xg = Ext.grid;
// shared reader
var reader = new Ext.data.ArrayReader({}, [
{name: 'sistema'},
{name: 'anagrama'},
{name: 'jp'},
{name: 'email'},
{name: 'telefono'}
]);
////////////////////////////////////////////////////////////////////////////////////////
// Grid para contener los sistemas para permitir la selección al usuario de los que participaran
// en la pruebai
////////////////////////////////////////////////////////////////////////////////////////
// Array data for the grids
Ext.grid.dummyData = [
['SCM','QY','C','c','666'],
['SCM','QY','C','c','666'],
['SCM','QY','C','c','666']
];
var sm = new xg.CheckboxSelectionModel();
var store = new Ext.data.Store({
reader: reader,
data: xg.dummyData
})
var cm=new xg.ColumnModel([
sm,
{id:'sistema',header: "Sistema", width: 100, sortable: true, dataIndex: 'sistema'},
{header: "Anagrama", width: 100, sortable: true, dataIndex: 'anagrama'},
{header: "Jefe de Proyecto", width: 100, sortable: true, dataIndex: 'jp'},
{header: "Email", width: 100, sortable: true, dataIndex: 'email'},
{header: "Telefono", width: 100, sortable: true, dataIndex: 'telefono'}
])
// turn on validation errors beside the field globally
Ext.form.Field.prototype.msgTarget = 'side';
/*
* ================ Formulario de Petición de Prueba Integrada =======================
*/
var tab2 = new Ext.FormPanel({
labelAlign: 'top',
title: 'Petición de Prueba de Prestaciones',
bodyStyle:'padding:5px',
width: 600,
items: [{
layout:'column',
border:false,
items:[{
columnWidth:.5,
layout: 'form',
border:false,
items: [{
xtype:'textfield',
fieldLabel: 'Proyecto',
name: 'proyecto',
anchor:'95%',
allowBlank:false,
maxLengthText:"5"
}]
},{
columnWidth:.5,
layout: 'form',
border:false,
items: [{
xtype:'textfield',
fieldLabel: 'Solicitante',
name: 'codpromdes',
anchor:'95%',
allowBlank:false
}]
}]
},{
xtype:'tabpanel',
plain:true,
activeTab: 0,
height:235,
defaults:{bodyStyle:'padding:10px'},
items:[{
title:'Planificación',
layout:'form',
defaults: {width: 230},
defaultType: 'textfield',
items: [{
xtype:"datefield",
fieldLabel:"Fecha Inicio Integración",
anchor:'25%',
format: "d/m/y",
name:"fec_inicio_integracion"
},{
xtype:"datefield",
fieldLabel:"Fecha Fin Integración",
anchor:'25%',
format: "d/m/y",
name:"fec_fin_integracion"
}
]
},{
title:'Acceso a la aplicación',
layout:'form',
defaults: {width: 230},
defaultType: "textfield",
items: [{
xtype:'textfield',
fieldLabel: 'Modo de acceso',
name: 'mod_acceso',
anchor:'50%',
allowBlank:true
},{
xtype:'textfield',
fieldLabel: 'Login',
name: 'login',
anchor:'30%',
allowBlank:true
},{
xtype:'textfield',
fieldLabel: 'Password',
name: 'password',
anchor:'30%',
allowBlank:true
}]
},{
cls:'x-plain',
title:'Descripción de las Pruebas',
layout:'fit',
items: {
xtype:'htmleditor',
id:'desc_pru'
}
},{
cls:'x-plain',
title:'Datos necesarios',
layout:'fit',
items: {
xtype:'htmleditor',
id:'desc_datos'
}
}]
}],
buttons: [{
text: 'Enviar',
handler:function()
{
Ext.MessageBox.show({
msg: 'Almacenando su solicitud, espere por favor...',
progressText: 'Guardando datos..',
width:300,
wait:true,
waitConfig: {interval:200},
icon:'ext-mb-download' //custom class in msg-box.html
});
setTimeout(function(){
//This simulates a long-running operation like a database save or XHR call.
//In real code, this would be in a callback function.
Ext.MessageBox.hide();
Ext.MessageBox.show({
title: 'OK',
msg: 'Solicitud de prueba de prestaciones almacenada',
buttons: Ext.MessageBox.OK,
fn: showResult,
icon: Ext.MessageBox.INFO
});
}, 8000);
}
},{
text: 'Cancelar'
}]
});
//tab2.render(document.body);
tab2.render("myDiv");
});
He probado a poner el atributo url:'miservlet' en la definición del formulario, en el botón... pero no lo he conseguido. Alguien me podria iluminar???
Gracias a todos por vuestra ayuda.
Un saludo!!!

