WebuiRequestContext context = event.getRequestContext();
UIDashboard uiDashboard = event.getSource();
String objectId = context.getRequestParameter(OBJECTID);
String maximize = context.getRequestParameter("maximize");
UIDashboardContainer uiDashboardCont = uiDashboard.getChild(UIDashboardContainer.class);
UIGadget uiGadget = uiDashboardCont.getUIGadget(objectId);
if (uiGadget == null || uiGadget.isLossData()) {
UIPortalApplication uiApp = Util.getUIPortalApplication();
uiApp.addMessage(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null));
context.setAttribute(APP_NOT_EXIST, true);
context.addUIComponentToUpdateByAjax(uiDashboard);
return;
}
// TODO nguyenanhkien2a@gmail.comá
// We need to expand unminimized state of uiGadget to view all body of
// gadget, not just a title with no content
uiGadget.getProperties().setProperty("minimized", "false");
uiDashboardCont.save();
if (maximize.equals("maximize") && context.getAttribute(UIDashboardContainer.SAVE_FAIL) == null) {
uiGadget.setView(UIGadget.CANVAS_VIEW);
uiDashboard.setMaximizedGadget(uiGadget);
} else {
uiGadget.setView(UIGadget.HOME_VIEW);
uiDashboard.setMaximizedGadget(null);
}
}