• 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
Re: How to preserve all the states of stateful components?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to preserve all the states of stateful components?


  • Subject: Re: How to preserve all the states of stateful components?
  • From: Paul Lynch <email@hidden>
  • Date: Fri, 29 Jun 2007 16:48:19 +0100

That's all a matter of perspective. It may be easier to change your perspective slightly than to rewrite your application :-). I'd say that the vast majority of web applications, not just WO ones, work by refreshing backtracked pages.

Paul

On 29 Jun 2007, at 15:19, Miguel Arroz wrote:

Hi!

No. The problem is not the browser making the request or fetching from its cache. The problem is that the pager component (and controller) internal structures are always in the last state. ie, imagine the controller has an array of the elements that are visible on the current page. When the user goes back, the pager component is the same. The problem is that all the data remains the same, so you will still be working with the data from the latest state, and not from the state you should be seeing. Disabling the cache may PREVENT the problem from happening (didn't test it), by simply returning the same page you were seeing. If you saw page 1, than 4, than 5, than 6, with the caching disbaled, when you clicked back, I guess you would always see the page 6. As I said, that would prevent the problem, but not solve it (people expect the "back" button works as expected).

On 2007/06/29, at 09:14, Paul Lynch wrote:

On 28 Jun 2007, at 22:31, Miguel Arroz wrote:

The pager kicks ass, as it handles huge amount of data, using the objectInRange stuff in Wonder to limit the resources usage. Everything works like a charm. Except... when the user clicks the evil back button.

There, two things happen: first, the objects shown on the screen are not the objects where actions will apply if you choose an action on a displayed object (the same problem descibred here - <http://groups.google.com/group/wotips/browse_thread/thread/ 7fd37a82e5175537/17cef74b566fadd7#17cef74b566fadd7>). Second, if you click on any link in the Pager (the Pager looks like "1 2 ... 56 57 58 59 ... 567 568"), the page where you'll end does not match the link you clicked, because the link targets have changed.

The problem is that the Pager is a stateful component, and everytime you change the page, the same components are reused (return null). So, when you click "back", what you see is NOT what you get.

Now... how do I solve this (in an elegant way, of course)? I think the best solution is, somehow, keeping the state (or part of it) of the component for all the pages. That way, when the user backtracks, and clicks on something in the pager, I would be able to go to the right state, and work from there.

Is this a situation that won't be resolved by response ().disableClientCaching()?


Paul


Miguel Arroz http://www.terminalapp.net http://www.ipragma.com





_______________________________________________ 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
References: 
 >How to preserve all the states of stateful components? (From: Miguel Arroz <email@hidden>)
 >Re: How to preserve all the states of stateful components? (From: Paul Lynch <email@hidden>)
 >Re: How to preserve all the states of stateful components? (From: Miguel Arroz <email@hidden>)

  • Prev by Date: Re: Refreshing complete page from a header component
  • Next by Date: Re: [ANN] WebObjects Community Survey 2007 !
  • Previous by thread: Re: How to preserve all the states of stateful components?
  • Next by thread: Re: How to preserve all the states of stateful components?
  • Index(es):
    • Date
    • Thread