PDA

View Full Version : help - formpanel & strtus2



arsenepark
30 Oct 2009, 11:58 AM
sorry if it's a double post

Hi, there
I am trying to send a large number of fields to the server, and I did it. As I am using struts2, all the fields are stored in a class. And the fields' names in FormPanel are all like 'mydata.username', 'mydata.major', 'mydata.grade'...
But, when I trying to get a record from the server, the record didnot display in the FormPanel. It's always alert 'failure'. The following is part of my .js code and server response.
Thanks.
Dennis


js source:

var comboVoteIntervalBegin = new Ext.form.ComboBox({
name: 'dss.voteTimeBegin',
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
value: '3',
store: new Ext.data.ArrayStore({
id: 0,
fields: [
'value',
'display'
],
data: [['3', '3'],['4', '4'],['5', '5'],['6', '6']]
}),
valueField: 'value',
displayField: 'display'
});
var dsConfigPanel = new Ext.FormPanel({
renderTo: 'oa-menu-dsconfig-div',
layout: 'table',
width: 1200,
height: 1350,
layoutConfig: {columns: 2},
defaults: {frame: true, width: 300, height: 1350},
reader: new Ext.data.JsonReader({
record: 'dss',
successProperty: 'success'
}, [
{name: 'dss.activeAutoBD', mapping: 'activeAutoBD'},
{name: 'dss.activeTraceBD', mapping: 'activeTraceBD'},
.........
]),
items: [
machineListGrid, {
title: 'Settings',
width: 900,
height: 1350,
items: [settingPanel]
}]
});
dsConfigPanel.getForm().load({
url: 'test.action',
waitMsg: 'Loading...',
params: {
'serverip': serverip
},
success: function(re, v) {
alert('success');
},
failure: function(form, action) {
alert('failure');
}
});


server response:
{"dss":{"activeAutoBD":null,"activeTraceBD":null, .........},"serverip":"192.168.0.23","success":true}

tryanDLS
31 Oct 2009, 4:18 PM
http://extjs.com/learn/Ext_Forum_Help#How_to_post_code_properly

arsenepark
1 Nov 2009, 12:26 AM
http://extjs.com/learn/Ext_Forum_Help#How_to_post_code_properly

sorry...

I solved part of the problem. Now the current question is :
http://www.extjs.com/forum/showthread.php?t=84306

Thanks.
Dennis