PDA

View Full Version : Delete document ..and then update the view


Fredric Berling
09-18-2007, 09:11 AM
I am deleting a document with this function..and my goal is to close the document tab and then refresh the content in the view to NOT show the deleted document. Using ths code , the view does not refresh..what am i doing wrong?...other approach?

I am using the Alpha2 R1 Ext.nd database (where the DominoUI is used).

this.deleteDocument = function(asUNID) {

if (asUNID != '') {
if (confirm('Are you sure you want to delete this document?'))
location.href = webPath + '/' + webView + '/' + asUNID + webQueryChar + 'DeleteDocument';
var panel = false;
panel = parent.ViewTemplateDefault.ui.layout.getRegion('center').getActivePanel();
try {
panel = parent.ViewTemplateDefault.ui.layout.getRegion('center').getActivePanel();
}catch(e) {
}
if (panel) {

var center = parent.ViewTemplateDefault.ui.layout.getRegion("center");
var centerPanel = center.getPanel('extnd-view');
centerPanel.refresh()
parent.ViewTemplateDefault.ui.layout.getRegion('center').remove(panel);
} else {
window.close();
}

}
}

RWaters
09-19-2007, 11:53 AM
It looks like you are calling centerPanel.refresh - this is only trying to redraw the content panel, it will not effect any grid's or other components within the panel.

in a2r1 we added a refresh method to the UIView class, I think something along these lines would work:

parent.ViewTemplateDefault.ui.uiView.refresh();

tarikonen
11-27-2007, 12:18 PM
Hi Richard, i have tested your method but i receive an error and the view doesn't refresh. Do you have some help for us...

Thanks in advance