anyone who develop custom forms based on EXT 2.0, please HELP and suggest how can i go further...
i created a js file with the following code, in which there is a Customer name business object with two fields Name and Age,
Code: Select all
[size=9]function myfunction (objectName, objectId, objectVersion)
{
// populate the form if not a new object
if (objectId > 0)
{
// use XML to extract the data for this object name and id
}
var panel = new Ext.FormPanel ({
labelWidth: 70,
width: 300,
height: 200,
items: [
{
xtype: "textfield",
name: "Name",
id: "Name",
// We can initialize with the value obtained from the server
//value: balanceValue,
anchor: "99%",
fieldLabel: "First Name"
},
{
xtype: "textfield",
name: "Age",
id: "Age",
anchor: "99%",
fieldLabel: "Age"
}
],
buttons: [
{
text: "Save",
handler: function () {
SaveCustomer(panel,objectName, objectId);
}
}
]
});
return panel;
};
function SaveCustomer(form, objectName, objectId){
xmlStr = "<form_data object_name=\"Customer\" form_context=\"create\" object_id="+objectId+" object_version=\"1\" form_name=\"main\"></form_data>"
//prepare xmlDoc
var xxmlDoc = parseXMLDocument(xmlStr);
var frmParser = new AwareApp.FormParser(xxmlDoc,true,true,true,null);
frmParser.m_formPanel=form;
var customPanel = frmParser.parse();
var options = {};
var tmp = new AwareApp.CustomPostFormDataAction(frmParser,options);
};[/size]