*/
private static void removeUIComponent(UIComponent uiComponent, PortalRequestContext pcontext, boolean isUpdate) {
UIContainer uiParent = uiComponent.getParent();
uiParent.getChildren().remove(uiComponent);
RequireJS module = pcontext.getJavascriptManager().require("SHARED/portal", "portal");
if (isUpdate) {
pcontext.addUIComponentToUpdateByAjax(uiParent);
pcontext.ignoreAJAXUpdateOnPortlets(true);
} else {
StringBuffer buffer = new StringBuffer();
buffer.append("portal.UIPortal.removeComponent('");
if (uiComponent instanceof UIPortlet) {
buffer.append(UI_PORTLET_PREFIX);
}
buffer.append(uiComponent.getId());
buffer.append("');");
module.addScripts(buffer.toString());
}
module.require("SHARED/portalComposer", "portalComposer").addScripts("portalComposer.toggleSaveButton();");
}