PDA

View Full Version : [SOLVED] Updating Panel html while loading FormPanel contents?



uzzikie
30 Jan 2008, 6:32 PM
i have got a FormPanel with several TextField elements
i am able to retrieve and fill the form by JSON data it receives

however there are some info that i which to display to the user and i do this by using a Panel and attaching it to the FormPanel



var email = new Ext.form.TextField({
fieldLabel: 'email',
name: 'email',
vtype: 'email',
anchor:'92%'
});


var msg = new Ext.Panel({
frame: false,
border: false,
header: false,
html: 'Please check the below information carefully before proceeding.'
});

....

var form_user = new Ext.FormPanel({
id: 'frmCreate',
width:600,
items: [ email , msg ]
});




is there anyway the html in 'msg' be updated as well when the form is propagated?
(the reason i need to use a Panel is because of the lengthy instructions and images that i need to show the user)

any leads?

catacaustic
30 Jan 2008, 7:21 PM
Where are you updating the info in the Panel from? Is it from a local source, being sent with the form data, or being sent from another server call?

aconran
30 Jan 2008, 10:06 PM
On a successful load you can setup a success callback which has access to the same raw json which was returned by your form loading. Give your msg panel an id (in the example I use 'msgPanel') and try something like this....



form_user.load({
// your standard configs...
success: function(form, action) {
Ext.getCmp('msgPanel').body.update(action.result.msg);
}
});

uzzikie
31 Jan 2008, 5:48 PM
thank you! it worked perfectly!

here's what I did

[CODE]
form_user.getForm().load({
url: '$script?rm=info