Re: [cgiapp] Problem with prerun_mode call from builder_controllers

2010-02-14 Thread Ron Savage
Hi

On Mon, 2010-02-15 at 08:57 +0200, Erez David wrote:
> Hi,
> 
> I did add some printing and indeed saw that the aplication is sending
> run_mod2 each time though I don't understand why...
> 
> The code of the cgiapp_prerun is almost exactly what I have posted.

This time examine the HTML at the client end. Is the value of the run
mode what you expect?

If not, the /output/ of the run mode is wrong.

If so, then the /input/ phase of the processing is setting it.

In other words, what value(s) for run mode are being send in both
directions?

-- 
Ron Savage
r...@savage.net.au
http://savage.net.au/index.html



#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] Problem with prerun_mode call from builder_controllers

2010-02-14 Thread Erez David
Hi,

I did add some printing and indeed saw that the aplication is sending
run_mod2 each time though I don't understand why...

The code of the cgiapp_prerun is almost exactly what I have posted.

On Fri, Feb 12, 2010 at 1:03 AM, Ron Savage  wrote:

> Hi Erez
>
> On Thu, 2010-02-11 at 17:21 +0200, Erez David wrote:
> > Hi,
> >
> > I am using the cgiapp_prerun in order to check some condition before
> moving
> > run-mode (Each tab in the application is a run mode...). if the condition
> is
> > match then I want to move to other run-mod.
> >
> > The code is:
> > sub cgiapp_prerun{
> > my $self = shift;
> > my $run_mode = shift;
> > if ($run_mode eq 'run_mod2'){
> > # Do some stuf...
> > $self->prerun_mode('run_mod3');
> > }
> > }
> >
> > and indeed the application goes to run_mod2 but than it stuck there...
> even
> > when I go to other run modes (run_mod4, run_mod5 etc...) it is still
> stuck
> > in run_mod 3.
> >
> >
> > Is there something wrong I am doing here?
>
> There must be something wrong, or you wouldn't be asking for help :-).
>
> It suggests to me that the code (CGI form submission data) is sending
> run_mod2 each time, and not what you think it is sending.
>
> I suggest you put some logging code in that sub and report both the run
> mode and the CGI form parameters.
>
> In cgiapp_prerun I always call a sub which does this (among other
> things):
>
> # Log the CGI form parameters.
>
> my($q) = $self -> query;
>
> $self -> log(info => '');
> $self -> log(info => $q -> url(-full => 1, -path => 1) );
> $self -> log(info => "Param: $_: " . $q -> param($_) ) for $q -> param;
>
> --
> Ron Savage
> r...@savage.net.au
> http://savage.net.au/index.html
>
>
>
> #  CGI::Application community mailing list  
> ####
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
> ####
> ##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
> ##  Wiki:  http://cgiapp.erlbaum.net/ ##
> ####
> 
>
>

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] Problem with prerun_mode call from builder_controllers

2010-02-11 Thread Ron Savage
Hi Erez

On Thu, 2010-02-11 at 17:21 +0200, Erez David wrote:
> Hi,
> 
> I am using the cgiapp_prerun in order to check some condition before moving
> run-mode (Each tab in the application is a run mode...). if the condition is
> match then I want to move to other run-mod.
> 
> The code is:
> sub cgiapp_prerun{
> my $self = shift;
> my $run_mode = shift;
> if ($run_mode eq 'run_mod2'){
> # Do some stuf...
> $self->prerun_mode('run_mod3');
> }
> }
> 
> and indeed the application goes to run_mod2 but than it stuck there... even
> when I go to other run modes (run_mod4, run_mod5 etc...) it is still stuck
> in run_mod 3.
> 
> 
> Is there something wrong I am doing here?

There must be something wrong, or you wouldn't be asking for help :-).

It suggests to me that the code (CGI form submission data) is sending
run_mod2 each time, and not what you think it is sending.

I suggest you put some logging code in that sub and report both the run
mode and the CGI form parameters.

In cgiapp_prerun I always call a sub which does this (among other
things):

# Log the CGI form parameters.

my($q) = $self -> query;

$self -> log(info => '');
$self -> log(info => $q -> url(-full => 1, -path => 1) );
$self -> log(info => "Param: $_: " . $q -> param($_) ) for $q -> param;

-- 
Ron Savage
r...@savage.net.au
http://savage.net.au/index.html



#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] Problem with prerun_mode call from builder_controllers

2010-02-11 Thread Mark Rajcok
I would like to see some more code in order to help you debug this.  How are
you setting the run mode in the application?

Also, if you print out or log the value of $run_mode each time
cgiapp_prerun() is called, what do you see?
-- Mark

On Thu, Feb 11, 2010 at 10:21 AM, Erez David  wrote:

> Hi,
>
> I am using the cgiapp_prerun in order to check some condition before moving
> run-mode (Each tab in the application is a run mode...). if the condition
> is
> match then I want to move to other run-mod.
>
> The code is:
> sub cgiapp_prerun{
>my $self = shift;
>my $run_mode = shift;
> if ($run_mode eq 'run_mod2'){
> # Do some stuf...
> $self->prerun_mode('run_mod3');
> }
> }
>
> and indeed the application goes to run_mod2 but than it stuck there... even
> when I go to other run modes (run_mod4, run_mod5 etc...) it is still stuck
> in run_mod 3.
>
> Is there something wrong I am doing here?
>
> Thanks
> Erez
>

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####