PDA

View Full Version : Sencha FormPanel



hiddenpremise
24 Mar 2011, 10:38 AM
SOLVED - MS VISTA ISSUE
My issue was caused by vista killing ajax post requests from any file that is running on the local filesystem. As soon as I uploaded my app to one of my servers, it ran fine.


Hi all,
I have a simple FormPanel with two fieldsets and a submit button for the items. I have standardSubmit set to false. When I call myFormPanel.submit() from within a button's handler, I can verify that a POST request is sent to the url on my server because I am dumping all requests to a log file. The problem is that the post request is empty of any values. If I call console.log(myFormPanel.getValues()), I see the values that I have written into the form are present. If I change standardSubmit to true, the values are posted. Has anyone seen this issue before?

Thanks,
W

What I get when I hit submit in the console:

index.js:46submitting
index.js:58failure [
Object
,
Object
,
Object
]


/* Define the home panel and its contents*/
var tabpanel;
var homePanel = new Ext.Panel({
title: 'Home',
iconCls: 'home',
html:'hi'
});

/* number of items */
var item_count = 1; //starts with 1 because that is the default number displayed

/* item prototype */
var item = {
name: 'item[' + item_count + ']',
label: 'Item ' + item_count
}

/* item FieldSet */
var itemFieldSet;
var itemFieldSetUN = {
title: 'Items: Please enter an item number or name',
items: [
new Ext.form.Text(item)
]
}

/* panel to hold the form */
var formPanel;
var formPanelUN = {
title: 'Item Request',
iconCls: 'labIcon',
url: 'http://MYSERVER/receive.php',
standardSubmit: false,
items: [
itemFieldSet = new Ext.form.FieldSet(itemFieldSetUN)
],
dockedItems: [
{
xtype: 'toolbar',
dock: 'bottom',
items: [
{
xtype: 'button',
text: 'Submit',
handler: function() {
console.log('submitting');
formPanel.submit();
}
}
]
}
],
listeners : {
submit : function(form, result){
console.log('success', Ext.toArray(arguments));
},
exception : function(form, result){
console.log('failure', Ext.toArray(arguments));
}
},
}

Ext.setup({
onReady: function() {
tabpanel = new Ext.TabPanel({
fullscreen: true,
ui: 'light',
dock: 'bottom',
tabBar: {
dock: 'bottom',
layout: {
pack: 'center'
}
},
items: [
homePanel,
{
title: 'About',
html: '<h1>About</h1>',
iconCls: 'info'
},
formPanel = new Ext.form.FormPanel(formPanelUN)
]
});
}
});