1 Reply Latest reply on Oct 7, 2011 11:03 AM by jlpktnst

    Caching In rich:Tab

    rushjudge

      Hello, i've been using richfaces for a year now and i really like its features. however, i have a small project that deals with a very large data to be displayed in a datatable ineach TAB. My question is: Can I cache or is there a way to cache the data when i first access or click the tabs in my page? I mean in my tabpanel, i have 3 tabs with switchType set to "ajax". in each tab i will display a large set of data in a datatable. I wanted a feature that when I access/click a tab for the first time, it will request to the server the data but refreshes only the contents of that tab thru ajax swithType which is OK. But when i go back to that cliked tab, it should not request for a data anymore. this feature is currently supported by the Primefaces Tab component which enables caching. I hope someone can help of this since i'll be displaying a huge amount of data and i dont want that on every switch on the tab, i sent request to the server. thank you in advance.

        • 1. Re: Caching In rich:Tab
          jlpktnst

          Yea, I would like to see this too. Would be useful on all panel components, right now I get this 1-2 sec waittime whenever a user clicks on tabs/menus.

           

          The user-experience would be much improved if second clicks on the same tab took zero time. The first time slow load is ok, but as it is now ajax loading is not so different from server loading - you have to wait everytime you click. Client loading though is fast after it is loaded. Actually, client loading might be much faster even though the initial load takes longer.

           

          Any way I can implement a cache like this with little hassle? I am not so familiar with jsf and richfaces yet, though I have done some javascript ajax caching in the past... this should be fairly simple on clientside, but I have no clue regarding jsf state and such in this case.

           

          edit: Doable with existing rich and a4j controls? As far as I searched I didn't find anything like this. Clues?

           

          Also openfaces has this implemented - in their demo for tabbed pane under loading methods: AjaxLazy and AjaxAlways, there you can nicely see what I mean.

           

          Now maybe I am wrong and richfaces actually use the first method, but so far it seems not.

           

          edit: Actually in my application tabPanel won't work at all in ajax mode (it works in client) as for server - it doesn't work either. The difference is in server mode I actually get an error (a few lines not to spam too much):

           

          WARNING: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
          javax.faces.component.UpdateModelException: javax.el.PropertyNotWritableException: /view/OsnovniPodatkiOsebe/osnovniPodatki.xhtml @20,27 value="": Illegal Syntax for Set Operation
           at javax.faces.component.UIInput.updateModel(UIInput.java:853)
           at javax.faces.component.UIInput.processUpdates(UIInput.java:735)
           at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1242)