return;
}
UIVirtualList virtualList = uiPageBrowser.getChild(UIVirtualList.class);
UIRepeater repeater = (UIRepeater)virtualList.getDataFeed();
PageListAccess datasource = (PageListAccess)repeater.getDataSource();
int currentPage = datasource.getCurrentPage();
dataService.remove(page);
//Minh Hoang TO: The cached UIPage objects corresponding to removed Page should be removed here.
//As we have multiple UIPortal, which means multiple caches of UIPage. It 's unwise to garbage
// all UIPage caches at once. Better solution is to clear UIPage on browsing to PageNode having Page
//removed
UIPortal uiPortal = Util.getUIPortal();
if (uiPortal.getSelectedNode().getPageReference().equals(page.getPageId()))
{
PageNodeEvent<UIPortal> pnevent =
new PageNodeEvent<UIPortal>(uiPortal, PageNodeEvent.CHANGE_PAGE_NODE, uiPortal.getSelectedNode()
.getUri());
uiPortal.broadcast(pnevent, Phase.PROCESS);
}
else
{
boolean dataAvailable = uiPageBrowser.feedDataWithQuery(uiPageBrowser.getLastQuery());
if (!dataAvailable)
{
showNoResultMessagePopup();
}
if (currentPage > datasource.getAvailablePage())
currentPage = datasource.getAvailablePage();
datasource.getPage(currentPage);
event.getRequestContext().addUIComponentToUpdateByAjax(uiPageBrowser);
}
//Update navigation and UserToolbarGroupPortlet if deleted page is dashboard page
if(page.getOwnerType().equals(PortalConfig.USER_TYPE)){