You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Adam Ratcliffe <ad...@mrigitech.com> on 2005/01/20 06:06:39 UTC

RE: [flow] global variable values lost between invocations - more info

Hi Mark,

I just did a quick test and found that the problem is occurring because the
2nd function
invocation, where the global is tested for the previously set value, is
coming from a
different sitemap.

Does this mean that each sitemap that uses a flowscript has its own separate
global variable
scope?

If so, is this a design issue that needs to be resolved i.e. where access to
shared globals
is required all matching is done in the same sitemap?

Thanks for your help,
Adam


> -----Original Message-----
> From: Mark Lundquist [mailto:ml@wrinkledog.com]
> Sent: Thursday, 20 January 2005 5:47 p.m.
> To: users@cocoon.apache.org
> Subject: Re: [flow] global variable values lost between invocations
>
>
>
> On Jan 19, 2005, at 8:31 PM, Adam Ratcliffe wrote:
>
> > I have a flowscript where I set the value of a global variable, call
> > cocoon.session to create a session, but find
> > that it's value is undefined when I next invoke a top-level function
> > in the script.
> >  
> > An excerpt from the script where the variable's value is set is:
> >  
> >     var mapContext;
> >     ....
> >     function createContext() {
> >         mapContext = new MapContext();
> >
> >         var session = cocoon.session;
>
> What version of Cocoon are you running?  A session is automatically
> created when the global variable is declared, you don't have to
> reference cocoon.session anymore... but that might be new in 2.1.6...
>
> —ml—
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org