PDA

View Full Version : how to get Sencha Touch form parameters in JSP



sim786
15 Jul 2011, 5:57 AM
Hi all
I have one sencha touch form after submitting form i want to redirect it to jsp.
in jsp i want to show
"Welcome <user> "

my js code
Ext.setup({
onReady: function() {
var loginForm = new Ext.form.FormPanel({
fullscreen : true,
scroll : "vertical",
layout : {
type : 'hbox',
//align : 'stretch',
pack : 'center'
},
defaults : {
flex : 1,
style : 'padding: 1px;'
},
dockedItems :[{
xtype : 'toolbar',
dock : 'top',
title:'CISCO EDM Touch'
},
{
xtype : 'toolbar',
dock : 'bottom',
items : [
{xtype : 'spacer'},
{
text: 'Login',
ui:'confirm',
handler : formSubmit // not in use . i m using other button
},
{
text: 'Reset',
ui : 'decline',
handler: function(){
loginForm.reset();
}
},
{xtype : 'spacer'}
]
}],//dockeditems

items: [{
xtype: 'fieldset',
id: 'loginFormSet',
title: 'Please Login',
items: [
{
xtype: 'textfield',
placeHolder: 'Username',
name: 'Username',
id: 'Username',
label: 'Username ',
labelWidth: '40%',
required: true
},
{
xtype: 'passwordfield',
placeHolder: 'Password',
name: 'Password ',
label: 'Password',
labelWidth: '40%',
required: true
},
{
xtype: "selectfield",
label: "Docbase ",
name: "docbasename",
labelWidth: '40%',
required: true,
placeholder: "Select Docbase",
options:[
{
text: 'Edmdev',
value: 'edmdev'
},
{
text: 'Edmint',
value: 'edmint'
}
]
},

{
xtype: 'checkboxfield',
id: 'RememberMe',
name: 'RememberMe',
label: 'Save login?',
labelWidth: '40%'
},

{
xtype: 'button',
text: 'Login',
ui: 'confirm',
style: 'margin:5%;',
handler: function() {
Ext.getBody().mask(false, '<div class="demos-loading">Loading&hellip;</div>');
Ext.Ajax.request({
url : 'http://10.70.230.184:8080/edmtouch/loginUser.jsp' ,
params: { Username : loginForm.getValues().Username, Password : loginForm.getValues().Password},
method: 'POST',
success: function ( result, request ) {
var jsonData = Ext.util.JSON.decode(result.responseText);
Ext.Msg.alert('Success', 'Data return from the server: '+ jsonData.msg);
},
failure: function ( result, request) {
Ext.Msg.alert('Failed', result.responseText);
}


});
}
},
{
xtype: 'button',
text: 'Reset',
ui : 'decline',
style: 'margin:5%;',
handler: function(){
loginForm.reset();
}
}
]//items
}]//items


});//form



} // end on ready
}); // end setup

--------
please help how to get username and how to write jsp for this
urget.
regards
Kasim