Re: Multiple queries to populate drop down list boxes. Updated

Mark Haney <markh-rOuQeLG7NUhWk0Htik3J/[email protected]> Tue, 09 Oct 2012 08:44:48 -0400
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Message-ID <[email protected]>
On 10/09/2012 07:50 AM, Mark Haney wrote:

>>
>
> That was originally the way I had it.  I was doing essentially what I
> had done with the previous SQL statement, going to each row and pushing
> it into an array. For some reason, it doesn't work the same way.
>
>

Well, after a weekend spent with my grandson, I started back on this 
yesterday and I have more to report here.  I ended up having to add a 
second field to the 'shifts' array, which makes it identical to the 
'factories' array.  So, you would think problem solved, right?  No.

It turns out that I'm having the same problem.  So, it occurred to me 
that maybe the issue isn't that part, but maybe it's in the code that 
passes the data to the template:

     my $file = 'templates/shift_rpt.html';
     my $vars = {
	#'cgi' =>CGI->new(),
	'factories' => \@rows_factory,  # This moves the data from the array 
into a var that gets carried into the template
	'shifts' => \@rows_shifts # This moves the custom shifts names into the 
dropdown box for the reports
	};

So, I tore everything out related to the 'factories' and just tried to 
pass the 'shifts' data to the template.  And NOTHING gets passed other 
than the name of the script name (shift_rpt.pl).  Which is precisely 
what was going on before.

Any ideas?

At this stage, I'm going to have to scrap TT and build this all in perl 
if I can't find an answer to this problem.

-- 

Mark Haney
Software Developer/Consultant
AB Emblem
markh-rOuQeLG7NUhWk0Htik3J/[email protected]
Linux marius.homelinux.org 3.5.1-1.fc17.x86_64 GNU/Linux