Error executing run mode 'display_employee_page':
HTML::Template->output() : fatal error in loop output : HTML::Template :
Attempt to set nonexistent parameter 'labor_category' - this parameter
name doesn't match any declarations in the template file :
(die_on_bad_params => 1) at C:/Perl/site/lib/HTML/Template.pm line 2997
  at lib//Trakker.pm line 142
  at D:/www/DEV/test/index.cgi line 14



I have 1 SQL call bringing back 3 values (BILL_CODE, LABOR_CATEGORY,
LABOR_CATEGORY_DESCRIPTION).

I have 3 separate loops using each of those. I am converting something
from TT->HT and this works fine in TT. Is there something about how HT
loops that is biting me? I am sure "I" am forgetting something.

Here is the SQL sub:

sub _get_employee_info {
     my $self = shift;

     my $sth = $self->dbh->prepare( select_employee_info() );
     $sth->execute;

     my $rs = $sth->fetchall_arrayref(
         {
             BILL_CODE => 1,
             LABOR_CATEGORY => 1,
             LABOR_CATEGORY_DESCRIPTION => 1,
         }
     );

     return $rs;
}

Here is the CA+HT runmode sub:
sub display_employee_page : Runmode {
     my $self = shift;
     my $errs = shift;

     my $q = $self->query;

     my $template = $self->load_tmpl( 'addemployee.tmpl' );

     my $employee_info = $self->_get_employee_info();

     $template->param(
         MODDATE => '04-Dec-2006',
         VERSION => $VERSION,
         EMPLOYEE_INFO => $employee_info,
     );

     $template->param($errs) if $errs;

     return $template->output();
}


Here is the TEMPLATE form:

<form name="tasks" action="" method="post">
<table id="formcontent" summary="main form for task input">

<tr>
<td class="labelcell">Last Name:</td>
<td>
<input type="text" name="last_name" size="25" /><TMPL_VAR err_last_name>
</td>
</tr>

<tr>
<td class="labelcell">First Name:</td>
<td>
<input type="text" name="first_name" size="25" /><TMPL_VAR err_first_name>
</td>
</tr>

<tr>
<td class="labelcell">Billing Code:</td>
<td>
<select name="bill_code">
<option value=""></option>
<TMPL_LOOP NAME=EMPLOYEE_INFO>
<option value="<TMPL_VAR NAME=BILL_CODE>"><TMPL_VAR NAME=BILL_CODE></option>
</TMPL_LOOP>
</select><TMPL_VAR err_bill_code>
</td>
</tr>

<tr>
<td>&nbsp;</td>
<td>- or -</td>
</tr>

<tr>
<td class="labelcell">Add Code:</td>
<td>
<input type="text" name="add_bill_code" size="10" /><TMPL_VAR
err_bill_code_or_add_bill_code>
</td>
</tr>

<tr>
<td class="labelcell">Labor Category:</td>
<td>
<select name="labor_category">
<option value=""></option>
<TMPL_LOOP NAME=EMPLOYEE_INFO>
<option value="<TMPL_VAR NAME=LABOR_CATEGORY>"><TMPL_VAR
NAME=LABOR_CATEGORY></option>
</TMPL_LOOP>
</select><TMPL_VAR err_labor_category>
</td>
</tr>

<tr>
<td>&nbsp;</td>
<td>- or -</td>
</tr>

<tr>
<td class="labelcell">Add Category:</td>
<td>
<input type="text" name="add_labor_category" size="9" /><TMPL_VAR
err_add_labor_category>
</td>
</tr>

<tr>
<td class="labelcell">Description:</td>
<td>
<select name="labor_category_description">
<option value=""></option>
<TMPL_LOOP NAME=EMPLOYEE_INFO>
<option value="<TMPL_VAR NAME=LABOR_CATEGORY_DESCRIPTION"><TMPL_VAR
NAME=LABOR_CATEGORY_DESCRIPTION></option>
</TMPL_LOOP>
</select><TMPL_VAR err_labor_category_description>
</td>
</tr>

<tr>
<td>&nbsp;</td>
<td>- or -</td>
</tr>

<tr>
<td class="labelcell">Add Description:</td>
<td>
<input type="text" name="add_labor_category_description" size="30"
/><TMPL_VAR err_add_labor_category_description>
</td>
</tr>

<tr>
<td>&nbsp;</td>
<td>
<input type="submit" value="Save Employee" class="formbutton" />
</td>
</tr>

</table>

</form>






-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to