hi


what happens is i cant get the state when the page refreshes ??? cp.get('thePage'); becomes undefined until i click the button again and set the cookie variable again then on teh second attempt it becomes the page name i whant. ????

i set the value of thePage cookie when a button in teh menu is clicked using a handler on the meny root not a listener specific.

i have

var cp = new Ext.state.CookieProvider({
path: "/cgi-bin/",
expires: new Date(new Date().getTime()+(1000*60*60*24*30)), //30 days
domain: "extjs.com"
});
Ext.state.Manager.setProvider(cp);
configd with my settings at the top of my page, when i refresh my page will i loose my cookie values?


basicaly this is my problem


i whant my settings window (a window with a tabbed panel) to display the right tab depending on what page we are on.

if(btn.id == 'settings') {

if(settingsWindow){
settingsWindow.show();
}
else {
thePage = cp.get('thePage');

// TO BE RE WORKED FOR PAGE SPECIFIC SETTINGS DISPLAY !!!
if(!thePage) thePage = 'callLog';

settingsWindow = new Ext.Window({
width: 600,
height: 300,
closeAction : 'hide',
bodyStyle: 'padding:10px 10px 10px 10px',
items: [{
xtype: 'tabpanel',
id: 'tabPanelSettings',
activeItem: thePage,
width: 565,
height: 265,
border: false,
items: [{
id: 'callLog',
title: 'Call logger',
listeners: {
activate: function(panel) {
panel.doLayout();
.......
...
.

var reportMenu = new Ext.menu.Menu({
id: 'reportMenu',
items: [{
id: "telstralinereport",
text: 'Telstra Line Report',
iconCls: 'bchart',
handler: onReportClick
}]
});

var callLogMenu = new Ext.menu.Menu({
id: 'callLogMenu',
items: [{
id: "bscalllog",
text: 'Call Log',
iconCls: 'bchart',
handler: onClickCallLog
}
]
});

function onClickCallLog(item){
//Ext.example.msg('Call Logger', 'You chose to run the "{0}" Call Log {1}.', item.text, item.id);
cp.set('thePage', 'callLog');
window.location = '/calls/index/showlog/id/' + item.id +'/title/' + item.text;
}


function onReportClick(item){
//Ext.example.msg('Run Report', 'You chose to run the "{0}" report {1}.', item.text, item.id);
cp.set('thePage', 'reports');
window.location = '/reports/index/showreport/id/' + item.id +'/title/' + item.text;
}
what happens is i cant get the state when the page refreshes ??? cp.get('thePage'); becomes undefined until i click the button again and set the cookie variable again then on teh second attempt it becomes the page name i whant. ????

thanks