PDA

View Full Version : ask for help, how to refrash the content of an Ext.form.TextArea



scarletthello
1 Aug 2010, 9:09 PM
Ext.onReady(displayInfo);

function displayInfo()
{
timerForRefreshInfo = setInterval(refreshInfo,2000);

var win=new Ext.Window({title:"TRAFFIC INFO",
width:400,
height:300,
maximizable:true,
items:[new Ext.form.TextArea({height:280,width:400,value:""})]
});
win.show();

}//function getLoginInfo()

function refreshInfo()
{
Ext.Ajax.request({
url : 'refreshInfo.jsp' ,
params : { },
method: 'GET',
success:function ( result, request )
{
if(result.responseText==="")
{

}
else
{
Ext.MessageBox.alert(result.responseText);
//?????
//here,I want to display the responseText in the Ext.Window's Ext.form.TextArea ,can anybody help me?
}
},
failure:function ( result, request)
{
}
});
}

yagi
1 Aug 2010, 11:09 PM
Did you get the responseText?

if so.., maybe you can use Ext.getCmp() method. But before that, create a variable to buffer the responseText value.
Ex :


var var_response = // assign the responseText here..
Ext.getCmp().setValue(var_response);


Please post your code using CODE tag, so it will be easily to read..

Hope it will help..