Rhet Turnbull wrote:
I would like to be able give CGI::Application a new query object after
new() has been called but query() seems to preclude this.  E.g. this
comment in the source:

(in sub query in CGI::Application)
# We're only allowed to set a new query object if one does not yet exist!

The reason I'd like to do this is that I need the user to be able to
jump from one runmode to another and then jump back to where they were
with the state restored as if they'd never left.  The specific
application is a "user preferences" page that's accessible from any
runmode.  Once they set the preferences, I want to jump back to where
they were.  I think I can do this by using CGI::save to save the state
(and stick it in a cookie) then check in cgiapp_prerun if the state
should be restored and restore it with a CGI::new but I need the new
CGI object to replace the one that CGI::Application has already
created.

I don't think this will work the way you intended. If you save the state just as you enter into the preferences page your CGI state won't reflect where they were, but where they want to go, ie preferences...


Unless you modify every run mode of every application module to save their state before returning to the browser (which would be unecessary most of the time and wasteful and would also cause problems if you save post data that then gets run again, etc) then this won't happen the way you want.

I think a better solution is to dynamically create the link (or form) that goes to the preferences page. It should add a 'redirect' parameter that would capture the url of where they just came to. This would then remeber where they came from. And you preferences module could check for this parameter and redirect them to that url after they are done.

This is actually the way that most login/etc pages work when you try to go somewhere else, but first need to login.

HTH

Any ides how to do this.  Also, what's the reason that I can't give
CGI::Application a new query object anytime I want?

Don't have an answer for you there... I'm sure there was a reason though...

--
Michael Peters
Developer
Plus Three, LP


--------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to