• 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: Jean-François Veillette <email@hidden>
  • Date: Thu, 28 Jun 2007 19:46:12 -0400

You can try to configure your wohyperlink to call a single method (could even be a direct-action method), but pass a parameter specifying the iterm you're looking for.
By default, the element id of the hyperlink will make reference to the index of the array, so instead of that you can use the key of your object (primary key, or any other unique key).
Your hyperlink will look like : ".../1.2.3.4&pk=5".
You just need to add " &pk = aUniqueIdentifierForThatItem; " to the wohyperlink.
And when you enter the action method, instead of taking the 'item', find the correct object based on that key (available in context.request.formvalueforkey.


(all from memory, you better look at the doc)

- jfv

Le 07-06-28 à 17:31, Miguel Arroz a écrit :

Hi!

Ok, this is a weird question. My problem is this: I implemented a pager and a pager controller. (I know all this stuff is in Wonder, but I'm a guy who needs to code to understand - see <http:// rentzsch.com/notes/programmersDontLikeToCode>).

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.

Another thing that worries me if what happens if people open several windows by apple-clicking on all the pager's links. This will create a confusing ramification in the component states. So, another solution (and I have NO idea how to do this) is to create a new Pager component every time the page reloads.

So, to the mighty experts who I keep boring with my stupid questions - what do I do now? Any tips?

  Yours

Miguel Arroz

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>)

  • Prev by Date: Re: Problem with a form
  • Next by Date: [ANN] WebObjects Community Survey 2007 !
  • Previous by thread: 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