PDA

View Full Version : problem with button click



manish khamar
25 Aug 2011, 10:56 PM
hello everybody.

I have some simple problem.

I post my code as below.

In my code when i click on button first time then it show me new FormPanel with html text Hello world.
Then i click on back button which is palced in toolbar and i come back on first page and if i again press button
then it's not working.

code:
----------------------------------------------------------------------------------------
Ext.setup({
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
icon: 'icon.png',
glossOnIcon: false,
onReady: function() {

var rootform=new Ext.form.FormPanel({
fullscreen: true,
items: [
{
xtype: "button",
ui:"round",
text: 'Click Me',
handler: function(){

var frm=new Ext.form.FormPanel({
fullscreen:true,
id:"main", //problem is here
scroll: 'vertical',

dockedItems: [{
xtype: 'toolbar',
items: [
{
xtype:"button",
name:"backmain",
ui:"back",
text:"Back",
handler: function(){
frm.hide();
}
}]
}],
items: [
{
html:"hello world"


}]

});

}

}]
});
}
});
---------------------------------------------------------------------------------------

I found solution that if i do not write id of frm formpanel then it's work properly.
But I have to write id for other use so pls help me to solve this problem