For your back button problem you should look into the history manager which
can help you recover if the user presses back to get into your app.

As for Steve's case where the user does not use the back button, I agree
that a SharedObject is probably the solution you'll want. However if you
did want it to be session based and wanted information stored on the server
you could use a stateful-class RemoteObject as place to store information,
then as you load you could access that object to get previous data. If it's
the first time you've hit the object with that session it could return
nothing.

Matt

-----Original Message-----
From: Jonathan Baney [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 07, 2004 9:59 AM
To: [email protected]
Subject: Re: [flexcoders] Re: Lifetime of _global vs Application.applicati
on

This is exactly what I'm going through right now. I have an app in 
which users can set messages, kind of a knowledgebase thing. In the 
messages, people can set links. Well, if you follow a link which can be 
anywhere on the web, then click the back button, the flex app 
reinitializes, and you are back to square one. You lose where you were 
at in the app. I decided to cache an object that contained some state 
variables in the java session, and just retrieve those when the app in 
initialized. I don't know if there is a better way to do it, but it 
seems to be working ok. 

Oh, and it was a pain in the ass to get the session data from within 
flex. Since I'm using jsp's to contain the mxml code anyway, I decided 
to retrieve the object from the jsp and just pass it into the component 
at runtime. I don't know if this is more efficient or not? Seems like 
calling the session in flex requires a few more hoops to jump through 
since it doesn't differentiate between a get and a set, both results go 
to your result method. Anyway, I tried it both ways and it works.

Hope this helps or would you like code?
Jonathan

sbyrne_dorado wrote:

> Matt,
>
> Good to know that the root application can be counted on to be
> ever-present; somehow I had gotten the impression that it was possible
> to swap it out, like going to a new page in HTML, but that's obviously
> not the case.
>
> One further question: I'm guessing that if the Flex application DID
> arrange to replace the content of the current browser page with
> another HTML page (say for previewing, although it's arguably not a
> good design), and then that HTML page had an affordance to go back
> into the Flex application (not through the back button/history stack),
> the new page's Flex application would have no state in common with
> the old Flex application, right? If I needed to pass information
> between the older Flex app instance and the newer one, I'd have to use
> something like SharedObjects to do it, correct?
>
> Thanks for all your help!!!
>
> --- In [email protected], Matt Chotin <[EMAIL PROTECTED]> wrote:
> > Assuming that you access the singleton using a static getInstance()
> method
> > it will not be removed. If you hang the singleton reference off the
> > application I suppose there is some chance of it being removed, but
> frankly
> > if you have anyone on your team who reassigns the application
> reference I
> > think I'd get rid of them. I have not thought of a valid use-case
> where the
> > root application would be replaced wholesale.
> >
>
>
>
> Yahoo! Groups Sponsor
> ADVERTISEMENT
> click here 
>
<http://rd.yahoo.com/SIG=129o0sdk8/M=295196.4901138.6071305.3001176/D=groups
/S=1705007207:HM/EXP=1084034999/A=2128215/R=0/SIG=10se96mf6/*http://companio
n.yahoo.com> 
>
>
>
> ------------------------------------------------------------------------
> Yahoo! Groups Links
>
> * To visit your group on the web, go to:
> http://groups.yahoo.com/group/flexcoders/
> 
> * To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
> 
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/>.
>
>

-- 
Jonathan Baney
Enterprise Data Modeler
Thunderbird Consulting Application Engineering: A division of ITS
Mesa Community College




Reply via email to