• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problem with pages saved in a variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with pages saved in a variable


  • Subject: Problem with pages saved in a variable
  • From: "Andri vonAllmen" <email@hidden>
  • Date: Tue, 13 Oct 2009 10:29:01 +0200

Dear List,

in an Applications Session, a NSMutableDictionary object is used for
"caching" pages. Everytime the "pageWithName" method is called, the
dictionary is queried in order to determine if the requested page does
already exist, if true the existing page is returned, else a new one is
generated and stored in the dictionary. This is made in Application.java
by overriding the "pageWithName" method:

  public WOComponent pageWithName(String aName, WOContext aContext) {
    Object result = null;
    if ( aContext.hasSession() ) result =
((NSMutableDictionary)((Session)aContext.session()).cachedPages()).objectForKey(aName);
    if ( result == null ) {
      result = super.pageWithName(aName, aContext);
      if ( aContext.hasSession() ) if ( aName != null )
((NSMutableDictionary)((Session)aContext.session()).cachedPages()).setObjectForKey(result,
aName);
    }
    return (WOComponent)result;
  }

This works with one exception. Making changes on Enterprise Objects is
not possible in every case. Saving changes works, if always the same
object is changed but not if two different objects are changed (changing
the first, saving the changes, then changing the second and saving the
changes). But if making changes on a object, saving it, and then revert
the changes (to the same state as before changing it the first time),
making changes on other objects is possible.

As mentioned in the WO API Reference, for pages being stored in a
variable the "ensureAwakeInContext" method has to be called, but this
has no effect. Same if refreshing the objects in the default editing
context ("refreshAllObjects", "refaultAllObjects") which is used on all
pages.

Any suggestions or other hints would be appreciated.

Regards
Andri


--- Disclaimer:
--------------------------------------------------------- This email and
contents is for use only by the intended recipient. If you are not the
individual or entity to whom it is addressed, you are hereby formally
notified that any use, copying or distribution of this email and
attachments, in whole or in part, is strictly prohibited. If you have
received this email in error, please notify the sender and delete the
message and attachment(s) from your system. Any views, opinions or
information, expressed or contained in this email, are those of the
sender and not necessarily reflect those of CEDES. To help protect our
environment, please avoid printing out this information unnecessarily.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Problem with pages saved in a variable
      • From: Stephane Guyot <email@hidden>
    • Re: Problem with pages saved in a variable
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: using the keys to navigate on an AjaxSelectionList
  • Next by Date: Re: using the keys to navigate on an AjaxSelectionList
  • Previous by thread: Re: Build failed
  • Next by thread: Re: Problem with pages saved in a variable
  • Index(es):
    • Date
    • Thread