PDA

View Full Version : [SOLVED]Close button...



ribayah
8 Jan 2008, 12:13 AM
Hi everybody,

I just started to work using fantastic Ext.nd with a new Notes database, but I can't make the Close button working. The JS code in the default button (from the sample form) is :

// get the active panel
var panel = false;
try {
panel = parent.DemoApp.ui.layout.getRegion('center').getActivePanel();
}catch(e) {
// do nothing
}

// remove active panel
if (panel) {
parent.DemoApp.ui.layout.getRegion('center').remove(panel);
} else {
window.close();
}

Firstly, the frameset is initialized with ViewTemplateDefault object name and not DemoApp.
Anyway, I changed the Close button JS code into :

// get the active panel
var panel = false;
try {
panel = parent.ViewTemplateDefault.ui.layout.getRegion('center').getActivePanel();
}catch(e) {
// do nothing
}

// remove active panel
if (panel) {
parent.ViewTemplateDefault.ui.layout.getRegion('center').remove(panel);
} else {
window.close();
}

But it still doesn't work and it seems normal while the 'ViewTemplateDefault' object doesn't contain an 'ui' object...
Ok let's go ahead & put an @Command([FileCloseWindow]) into the button code.
It closes the document but not the tab in which the complete frameset is now opened...

I think I am stuck with it.
How can I get a close button that closes the tab correctly?

RWaters
8 Jan 2008, 12:37 PM
this is a known issue with our last release. The fix made it into the DemoApp example, but not into the viewtemplate defualt. You will need to change the line in the view templates HTML Head from:


var ui = new Ext.nd.DominoUI({

To:


this.ui = new Ext.nd.DominoUI({


That will fix the issue of not being able to acces the 'ui' object.

ribayah
8 Jan 2008, 11:52 PM
Thanks it worked great!