0

Application Cache - All views should be able to access the cache

All,

Is there a global cache reference that could be used so that all views in the widget can read and write to it ? this.cache seems to be local reference for the particular view .

Thanks is advance

by
7 Replies
  • QUOTE (Balaji @ Jan 31 2011, 10:21 AM) <{POST_SNAPBACK}>
    All,

    Is there a global cache reference that could be used so that all views in the widget can read and write to it ? this.cache seems to be local reference for the particular view .

    Thanks is advance


    I guess "currentAppConfig" is the global reference. Please correct me if i am wrong
    0
  • You are wrong. The currentAppConfig is a tool to save persistent information within the application.

    Please provide some context on what you are trying to accomplish. Have you looked at the MessageCenter functionality?
    0
  • QUOTE (Balaji @ Jan 31 2011, 10:21 AM) <{POST_SNAPBACK}>
    All,

    Is there a global cache reference that could be used so that all views in the widget can read and write to it ? this.cache seems to be local reference for the particular view .

    Thanks is advance

    That cache object is bound to the class, as is the persist object and the controls object and as such is only available to a particular view. Look at the message center. You can also subscribe to it. As was said, this is probably what you want.
    0
  • QUOTE (WidgetRealm @ Jan 31 2011, 10:44 AM) <{POST_SNAPBACK}>
    You are wrong. The currentAppConfig is a tool to save persistent information within the application.

    Please provide some context on what you are trying to accomplish. Have you looked at the MessageCenter functionality?


    Hi does within application = all view classes in the particular widget ?

    MY scenario,
    * I am pulling data async from http service,

    * This data has to be parsed and split and stored so that different views in the widget can access the data in the update view method.

    Intent is fetch the data during widget initialization and store the processed data in a place where all views in the widget can access the data to and invoke updateview

    Hope this clarifies my intent
    0
  • QUOTE (Benjamin Toll @ Jan 31 2011, 12:31 PM) <{POST_SNAPBACK}>
    That cache object is bound to the class, as is the persist object and the controls object and as such is only available to a particular view. Look at the message center. You can also subscribe to it. As was said, this is probably what you want.

    How about currentAppConfig ? is that specific to class or for all classes in the widget ?
    0
  • As stated before, look at the message center. It has everything you need.
    0
  • QUOTE (Balaji @ Feb 1 2011, 09:25 AM) <{POST_SNAPBACK}>
    How about currentAppConfig ? is that specific to class or for all classes in the widget ?

    For your use case, you should use the message center. Note that the message center broadcasts an event that you can subscribe to when data is stored in it. I use this all the time for asynchronous calls.

    For more information about currentAppConfig and other persistent settings, see this page.
    0

Recent Posts

in Non-Technical / Business - Yahoo! TV Widgets