public static class SaveActionListener extends EventListener<UIPageForm> {
public void execute(Event<UIPageForm> event) throws Exception {
UIPageForm uiPageForm = event.getSource();
UIPortalApplication uiPortalApp = uiPageForm.getAncestorOfType(UIPortalApplication.class);
PortalRequestContext pcontext = (PortalRequestContext) event.getRequestContext();
UIMaskWorkspace uiMaskWS = uiPortalApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
UIPage uiPage = uiPageForm.getUIPage();
if (uiPage == null)
return;
Page page = new Page();
uiPageForm.invokeSetBindingBean(page);
uiPage.setAccessPermissions(page.getAccessPermissions());
uiPage.setEditPermission(page.getEditPermission());
uiPage.setTitle(page.getTitle());
uiPage.setShowMaxWindow(page.isShowMaxWindow());
uiMaskWS.createEvent("Close", Phase.DECODE, pcontext).broadcast();
pcontext.getJavascriptManager().require("SHARED/portalComposer", "portalComposer")
.addScripts("portalComposer.toggleSaveButton();");
}