In the parent project 'clearInnerComponentState' method I get the
child component (an AbstractComponent type) and call the clearState
method like this:

public void clearInnerComponentState() {
  AbstractCreateComponent component =
    (AbstractCreateComponent)
ERXWOContext.contextDictionary().objectForKey("KEY");

  if (component != null) {
     component.clearState();
  }
}
if all you're trying to do is trigger cache/state invalidation, check out ERXLazyValue, which has lots of hooks to do this kind of stuff ... I use it to do cache change notifications across the page:

_newRequests = new ERXLazyValue<NSArray<Request>>(this, "uncachedNewRequests", new ERXLazyValue.AjaxPageUserInfoCacheKeyInvalidator("hatchRequests"));

public NSArray<Request> uncachedNewRequests() {
  // fetches from the db
}

public NSArray<Request> newRequests() {
    return _newRequests.value();
}

and in the saveRequest() of an ajax component across the page:
new ERXLazyValue .AjaxPageUserInfoCacheKeyInvalidator("hatchRequests").timestamp();

(in the general case, you would stick the invalidator somewhere in the page so that everyone is talking to the same instance -- it just happens that the impl of AjaxPageUserInfoCache is backed by a page- global store and are stateless, so you can just make new ones)

there's a big pile of impls of the invalidators to support different methods of invalidating ...

ms

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to