bug 2921 : The earlier change to diable paging on search results resulted in a division by zero error when there were no search results. Now fixed.

This commit is contained in:
sb 2009-05-12 14:29:12 +00:00
parent ba7e48348a
commit 9fac74f803
2 changed files with 20 additions and 17 deletions

View file

@ -9,8 +9,8 @@
Transform ADL into (partial) controller classes
$Author: sb $
$Revision: 1.41 $
$Date: 2009-05-11 15:01:49 $
$Revision: 1.42 $
$Date: 2009-05-12 14:29:12 $
-->
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
@ -72,7 +72,7 @@
//
// Automatically generated abstract super class for controllers for the
// <xsl:value-of select="/adl:application/@name"/> application; generated using
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.41 $', 10)"/>
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.42 $', 10)"/>
//
// <xsl:value-of select="/adl:application/@revision"/>
//
@ -182,7 +182,7 @@
//
// Controller for auto-generated forms for editing <xsl:value-of select="@name"/>s
// Automatically generated from application description using
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.41 $', 10)"/>
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.42 $', 10)"/>
//
// This file is automatically generated; DO NOT EDIT IT.
//
@ -772,7 +772,8 @@
IList&lt;<xsl:value-of select="concat( $entityns, '.', @name)"/>&gt; instances = search.List&lt;<xsl:value-of select="concat( $entityns, '.', @name)"/>&gt;();
/* bug 2921: suppress pagination when searching, as we can't fold the search params into the pagination */
int showRecords = instances.Count;
/* if no instances, set showRecords to one else we get a division by zero error */
int showRecords = instances.Count > 0? instances.Count: 1;
if ( ! withSearchCriteria) {
showRecords = <xsl:value-of select="$records-per-page"/>;