You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Johannes Becker <jo...@gmx.net> on 2005/07/13 14:53:57 UTC
Flow - How to set variables after sendPage
Hi,
I've got a function.
function myFunc(){
...
cocoon.sendPage("xxx", {
myVariable: myVariable,
});
}
Right after this cocoon.sendPage I want to set a global variable (in my case
myVariable) "automatically":
myVariable = null;
But how can I do that?
Thanks
Jonny
--
GMX DSL = Maximale Leistung zum minimalen Preis!
2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Flow - How to set variables after sendPage
Posted by Antonio Gallardo <ag...@agssa.net>.
Sorry sent by error:
Antonio Gallardo wrote:
> Johannes Becker wrote:
>
>> Sory for the late reply but my internet was temporarely down.
>>
>> > please explain, what are you trying to do
>> Right after cocoon.sendPage I want to set a global variable. Thats all.
>>
>>
>> I solved the problem like this. But looking at this piece of code
>> again, I wonder why it works. Whatever! It woks. I'm happy.
>>
>> function myFunc(){
>> while(myVariable){
>> cocoon.sendPage("xxx", {
>> myVariable: myVariable,
>> });
>> myVariable = null:
>> }
>> }
>
Of course it works. ;-D
The second parameter in sendPage() is just reading the value of your
global variable. ;-)
In other way, the value sent in the sendPage() has the same value as
your global variable, but they are not the same value, they don't share
the same memory space.
Best Regards,
Antonio Gallardo
> Best Regards,
>
> Antonio Gallardo
>
>>
>> Cheers
>> Jonny
>>
>>
>> Antonio Gallardo wrote:
>>
>>> IIRC, sendPage forks the execution, so if you set the variable right
>>> after the sendPage() call, is posible the global variable is setted
>>> before the sendPage() call finish.
>>>
>>> Hmm.... please explain, what are you trying to do. Perhaps there is
>>> another way to accomplish that.
>>>
>>> Best Regards,
>>>
>>> Antonio Gallardo.
>>>
>>> Johannes Becker wrote:
>>>
>>>> Hi,
>>>>
>>>> I've got a function.
>>>>
>>>> function myFunc(){
>>>> ...
>>>> cocoon.sendPage("xxx", {
>>>> myVariable: myVariable,
>>>> });
>>>> }
>>>>
>>>> Right after this cocoon.sendPage I want to set a global variable
>>>> (in my case
>>>> myVariable) "automatically":
>>>> myVariable = null;
>>>>
>>>> But how can I do that?
>>>>
>>>> Thanks
>>>> Jonny
>>>>
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
>
>
>
> ---------------------------------------------------------------------
> 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
Re: Flow - How to set variables after sendPage
Posted by Antonio Gallardo <ag...@agssa.net>.
Johannes Becker wrote:
> Sory for the late reply but my internet was temporarely down.
>
> > please explain, what are you trying to do
> Right after cocoon.sendPage I want to set a global variable. Thats all.
>
>
> I solved the problem like this. But looking at this piece of code
> again, I wonder why it works. Whatever! It woks. I'm happy.
>
> function myFunc(){
> while(myVariable){
> cocoon.sendPage("xxx", {
> myVariable: myVariable,
> });
> myVariable = null:
> }
> }
Of course it works. ;-D
The second parameter in sendPage() is just reading the value of your
global variable. ;-)
In other way, the value sent in the sendPage() has the same value as
your global variable, but they not share the same space value. are not
the same is the same variable as your global variable.
Best Regards,
Antonio Gallardo
>
> Cheers
> Jonny
>
>
> Antonio Gallardo wrote:
>
>> IIRC, sendPage forks the execution, so if you set the variable right
>> after the sendPage() call, is posible the global variable is setted
>> before the sendPage() call finish.
>>
>> Hmm.... please explain, what are you trying to do. Perhaps there is
>> another way to accomplish that.
>>
>> Best Regards,
>>
>> Antonio Gallardo.
>>
>> Johannes Becker wrote:
>>
>>> Hi,
>>>
>>> I've got a function.
>>>
>>> function myFunc(){
>>> ...
>>> cocoon.sendPage("xxx", {
>>> myVariable: myVariable,
>>> });
>>> }
>>>
>>> Right after this cocoon.sendPage I want to set a global variable (in
>>> my case
>>> myVariable) "automatically":
>>> myVariable = null;
>>>
>>> But how can I do that?
>>>
>>> Thanks
>>> Jonny
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Flow - How to set variables after sendPage
Posted by Johannes Becker <jo...@gmx.net>.
Sory for the late reply but my internet was temporarely down.
> please explain, what are you trying to do
Right after cocoon.sendPage I want to set a global variable. Thats all.
I solved the problem like this. But looking at this piece of code again,
I wonder why it works. Whatever! It woks. I'm happy.
function myFunc(){
while(myVariable){
cocoon.sendPage("xxx", {
myVariable: myVariable,
});
myVariable = null:
}
}
Cheers
Jonny
Antonio Gallardo wrote:
> IIRC, sendPage forks the execution, so if you set the variable right
> after the sendPage() call, is posible the global variable is setted
> before the sendPage() call finish.
>
> Hmm.... please explain, what are you trying to do. Perhaps there is
> another way to accomplish that.
>
> Best Regards,
>
> Antonio Gallardo.
>
> Johannes Becker wrote:
>
>> Hi,
>>
>> I've got a function.
>>
>> function myFunc(){
>> ...
>> cocoon.sendPage("xxx", {
>> myVariable: myVariable,
>> });
>> }
>>
>> Right after this cocoon.sendPage I want to set a global variable (in
>> my case
>> myVariable) "automatically":
>> myVariable = null;
>>
>> But how can I do that?
>>
>> Thanks
>> Jonny
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> 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
Re: Flow - How to set variables after sendPage
Posted by Antonio Gallardo <ag...@agssa.net>.
IIRC, sendPage forks the execution, so if you set the variable right
after the sendPage() call, is posible the global variable is setted
before the sendPage() call finish.
Hmm.... please explain, what are you trying to do. Perhaps there is
another way to accomplish that.
Best Regards,
Antonio Gallardo.
Johannes Becker wrote:
>Hi,
>
>I've got a function.
>
>function myFunc(){
> ...
> cocoon.sendPage("xxx", {
> myVariable: myVariable,
> });
>}
>
>Right after this cocoon.sendPage I want to set a global variable (in my case
>myVariable) "automatically":
>myVariable = null;
>
>But how can I do that?
>
>Thanks
>Jonny
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org