PDA

View Full Version : Direct Form: API Submit



Artistan
24 Aug 2010, 7:16 AM
setting an api.submit value does not seem to work. I keep getting an error.


uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: http://extadmin2.zenddev.net/js/ext-3.2.1/adapter/ext/ext-base.js :: i :: line 7" data: no]


my container panel has this...


saveNote: function(){
try{
var x_form = this.form.getForm();
var tab = this.tabs.getActiveTab();
//x_form.baseParams = tab.store.baseParams;
console.log(x_form);
x_form.submit({waitMsg:'Saving Data...'});

} catch(e) {
console.log(e,this);
}
},


notice i commented out the override of the baseparams.
when I inspect the logged form the baseparams, api, and paramOrder are NOT set and I have no idea what is up.

where is the code generated by designer.



/*
* File: BenAdmin.formpanel.companynotes.ui.js
* Date: Tue Aug 24 2010 10:11:24 GMT-0500 (Central Daylight Time)
*
* This file was generated by Ext Designer version xds-1.0.2.11.
* http://www.extjs.com/products/designer/
*
* This file will be auto-generated each and everytime you export.
*
* Do NOT hand edit this file.
*/

Ext.ns('BenAdmin.formpanel');
BenAdmin.formpanel.companynotesUi = Ext.extend(Ext.form.FormPanel, {
title: 'Create Note',
width: 310,
collapsible: true,
defaultType: 'textfield',
autoScroll: true,
padding: 10,
frame: true,
waitTitle: 'Processing Request...',
initComponent: function() {
this.defaults = {
"width": 166
};
this.paramOrder = [
't_ticket_type',
'compid',
'sitename'
];
this.baseParams = {
t_ticket_type: "1",
compid: "2",
sitename: "3"
};
this.api = {
submit: BenAdmin.DirectAPI.mod_Support_Notes.update
};
this.items = [
{
xtype: 'textfield',
fieldLabel: 'Call Back',
name: 'callback'
},
{
xtype: 'textarea',
anchor: '100%',
fieldLabel: 'Notes',
name: 'tn_note'
},
{
xtype: 'textfield',
fieldLabel: 'Minutes',
name: 'tn_work_minutes',
inputType: 'numeric',
value: 5
}
];
this.fbar = {
xtype: 'toolbar',
items: [
{
xtype: 'button',
text: 'Save',
iconCls: 'icn-save',
ref: '../save'
}
]
};
BenAdmin.formpanel.companynotesUi.superclass.initComponent.call(this);
}
});

Artistan
24 Aug 2010, 9:28 AM
Tried this with same result.
Help would be appreciated.


/*
* File: BenAdmin.formpanel.companynotes.ui.js
* Date: Tue Aug 24 2010 10:11:24 GMT-0500 (Central Daylight Time)
*
* This file was generated by Ext Designer version xds-1.0.2.11.
* http://www.extjs.com/products/designer/
*
* This file will be auto-generated each and everytime you export.
*
* Do NOT hand edit this file.
*/

Ext.ns('BenAdmin.formpanel');
BenAdmin.formpanel.companynotesUi = Ext.extend(Ext.form.FormPanel, {
title: 'Create Note',
width: 310,
collapsible: true,
defaultType: 'textfield',
autoScroll: true,
padding: 10,
frame: true,
waitTitle: 'Processing Request...',
defaults: {
"width": 166
},
api: {
submit: BenAdmin.DirectAPI.mod_Support_Notes.update
},
paramOrder: [
't_ticket_type',
'compid',
'sitename'
],
baseParams: {
t_ticket_type: "1",
compid: "2",
sitename: "3"
},
initComponent: function() {
this.items = [
{
xtype: 'textfield',
fieldLabel: 'Call Back',
name: 'callback'
},
{
name: 'tn_employee',
fieldLabel: 'Employee',
xtype: 'benadmin_combo_supportemployee'
},
{
name: 'tn_priority',
fieldLabel: 'Priority',
xtype: 'benadmin_combo_supportpriority'
},
{
xtype: 'textarea',
anchor: '100%',
fieldLabel: 'Notes',
name: 'tn_note'
},
{
xtype: 'textfield',
fieldLabel: 'Minutes',
name: 'tn_work_minutes',
inputType: 'numeric',
}
];
this.fbar = {
xtype: 'toolbar',
items: [
{
xtype: 'button',
text: 'Save',
iconCls: 'icn-save',
ref: '../save'
}
]
};
BenAdmin.formpanel.companynotesUi.superclass.initComponent.call(this);
}
});

jarrednicholls
30 Aug 2010, 6:45 AM
Hi Artisan,

This is an open ticket #197 for components that are configured via initialConfig, such as FormPanel & BasicForm. It will be corrected with the next maintenance release. Thanks.