@Override public Object fireNow(D2WContext c) { WOComponent component = ERXWOContext.currentContext().component(); D2WPage currentPage = ERD2WUtilities.enclosingComponentOfClass(component, D2WPage.class); if (ERD2WUtilities.enclosingPageOfClass(currentPage, D2WPage.class) == null) { try { Class<?> clazz = Class.forName((String) value()); return clazz.newInstance(); } catch (Exception e) { throw NSForwardException._runtimeExceptionForThrowable(e); } } return null; }
// FIXME resetting the caches breaks the context in the embedded component public void resetCaches() { // log.debug("Resetting caches"); // takeValueForKey(null,"_task"); // this will break in 5.0 :-) // takeValueForKey(null,"_entityName"); // Finalizing a context is a protected method, hence the utility. // ERD2WUtilities.finalizeContext((D2WContext)valueForKey("subContext")); // takeValueForKey(null,"_context"); // HACK HACK HACK ak: When you have several embedded list components in // a tab page // D2W gets very confused about the keys. It will assume that the // objects on the second tab somehow belong to the first // resetting the cache when setting a new page configuration prevents // this D2WContext subContext = (D2WContext) valueForKey("subContext"); ERD2WUtilities.resetContextCache(subContext); subContext.setDynamicPage((String) valueForBinding("_dynamicPage")); subContext.takeValueForKey(D2WModel.One, D2WModel.FrameKey); subContext.takeValueForKey(session(), D2WModel.SessionKey); }