More newbie questions: can't find object by ID?
Hi all (again), Here's my code: DTML Document at /Reporting/Admin/report_management.html <!--#var standard_html_header--> <!--#if tblReportType--> <table> <tr><th>ID</th><th>Report Description</th></tr> <!--#in tblReportType sort=description--> <tr> <td><!--#var reportTypeID--></td> <td><!--#var description--></td> </tr> <!--#/in--> </table> <!--#else--> <BR><BR> There are no defined reports at this time. <BR><BR> <!--#/if--> <!--#var standard_html_footer--> tblReportType is a SQL Method: Z SQL Method at /Reporting/Admin/admin_sql/tblReportType tblReportType has been tested and it works fine, returning two records. However, the above document returns only "There are no defined reports at this time." If I remove the '#if' tags, I receive: Zope has encountered an error while publishing this resource. Error Type: KeyError Error Value: tblReportType Why is Zope not finding the SQL Method? Thanks, -scott
Scott Anderson schrieb:
Hi all (again),
Here's my code:
DTML Document at /Reporting/Admin/report_management.html <!--#var standard_html_header--> <!--#if tblReportType--> <table> <tr><th>ID</th><th>Report Description</th></tr> <!--#in tblReportType sort=description--> <tr> <td><!--#var reportTypeID--></td> <td><!--#var description--></td> </tr> <!--#/in--> </table> <!--#else--> <BR><BR> There are no defined reports at this time. <BR><BR> <!--#/if--> <!--#var standard_html_footer-->
tblReportType is a SQL Method: Z SQL Method at /Reporting/Admin/admin_sql/tblReportType
tblReportType is in a subfolder of the folder containing the calling DTML Document. So the sql-method can't be found when it is called. Use the <!--#with--> tag in your DTML Document to add the subfolder to the namespace: <!--#with admin_sql--> <table> <tr><th>ID</th><th>Report Description</th></tr> <!--#in tblReportType sort=description--> <tr> <td><!--#var reportTypeID--></td> <td><!--#var description--></td> </tr> <!--#/in--> </table> <!--#/with admin_sql--> <!--#var standard_html_footer--> regards, thomas -- fon: ++49 (0)40 42878 3781 fax: ++49 (0)40 42878 2728
participants (2)
-
Scott Anderson -
Thomas Weiner