@Override public void beforeClientResponse(boolean initial) { super.beforeClientResponse(initial); if (getCompositionRoot() == null) { throw new IllegalStateException( "A composite must always have a composition root"); } }
@Override public void beforeClientResponse(boolean initial) { super.beforeClientResponse(initial); String html = content.getMinimizedValueAsHTML(); if (html == null) { html = ""; } getState().html = html; }
@Override public void beforeClientResponse(boolean initial) { super.beforeClientResponse(initial); getState().isFirstUpdate &= initial; }
@Override public void beforeClientResponse(boolean initial) { super.beforeClientResponse(initial); getState().active = active; }
@Override public void beforeClientResponse(boolean initial) { super.beforeClientResponse(initial); getState().immediate = isImmediate(); }
@Override public void beforeClientResponse(boolean initial) { try { header.sanityCheck(); footer.sanityCheck(); } catch (Exception e) { e.printStackTrace(); setComponentError(new ErrorMessage() { @Override public ErrorLevel getErrorLevel() { return ErrorLevel.CRITICAL; } @Override public String getFormattedHtmlMessage() { return "Incorrectly merged cells"; } }); } super.beforeClientResponse(initial); }
@Override public void beforeClientResponse(boolean initial) { super.beforeClientResponse(initial); if (initial || isDirty()) { if (pivotTable != null) { // Full repaint String dataJsonSting = pivotTableSerializer.serializeData(pivotTable); log.trace("pivotTable data JSON:\n{}", dataJsonSting); getState().data = dataJsonSting; String optionsJsonString = pivotTableSerializer.serialize(pivotTable); log.trace("pivotTable options JSON:\n{}", optionsJsonString); getState().options = optionsJsonString; } dirty = false; } }
@Override public void beforeClientResponse(boolean initial) { super.beforeClientResponse(initial); if (initial || this.structureChanged) { JsonArray menuTreeJson = toJson(menuItems); getRpcProxy(CubaSideMenuClientRpc.class).buildMenu(menuTreeJson); this.structureChanged = false; } if (this.selectedChanged) { String key = selectedItem == null ? null : menuItemIdMapper.key(selectedItem); getRpcProxy(CubaSideMenuClientRpc.class).selectItem(key); this.selectedChanged = false; } if (!badgeUpdates.isEmpty()) { Map<String, String> updatedBadgeValues = new HashMap<>(); for (MenuItem updatedItem : badgeUpdates) { // send null as empty string to remove badge String badgeText = updatedItem.getBadgeText(); updatedBadgeValues.put(menuItemIdMapper.key(updatedItem), badgeText != null ? badgeText : ""); } badgeUpdates.clear(); getRpcProxy(CubaSideMenuClientRpc.class).updateBadge(updatedBadgeValues); } }
@Override public void beforeClientResponse(boolean initial) { super.beforeClientResponse(initial);
@Override public void beforeClientResponse(boolean initial) { super.beforeClientResponse(initial); // Steal caption from target view if not explicitly defined String caption = getState().caption; AbstractComponent targetView = (AbstractComponent) getState() .getTargetView(); String targetViewCaption = getState().getTargetViewCaption(); if (caption == null) { caption = targetViewCaption; if (caption == null && targetView != null) { caption = targetView.getCaption(); } } getState().caption = caption; if (getState().getTargetViewCaption() == null) { if (targetView == null) { getState().setTargetViewCaption(caption); } } }
@Override public void beforeClientResponse(boolean initial) { super.beforeClientResponse(initial);