bug 2921 : Frankly this is a solution I take no pride in. Paging is disabled on search. This is OK if search is sufficiently focussed, but a bit untidy when it isn't.

status 2921: resolved FIXED
This commit is contained in:
sb 2009-05-11 15:01:49 +00:00
parent 74e730c444
commit ba7e48348a
2 changed files with 53 additions and 16 deletions

View file

@ -9,8 +9,8 @@
Transform ADL into (partial) controller classes
$Author: sb $
$Revision: 1.40 $
$Date: 2009-05-08 16:27:24 $
$Revision: 1.41 $
$Date: 2009-05-11 15:01:49 $
-->
<!-- 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.40 $', 10)"/>
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.41 $', 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.40 $', 10)"/>
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.41 $', 10)"/>
//
// This file is automatically generated; DO NOT EDIT IT.
//
@ -741,6 +741,7 @@
ICriteria search =
hibernator.CreateCriteria(typeof(<xsl:value-of select="concat( $entityns, '.', @name)"/>));
Boolean withSearchCriteria = false;
<xsl:for-each select="adl:property">
<xsl:variable name="base-type">
@ -758,8 +759,10 @@
<xsl:with-param name="property" select="."/>
<xsl:with-param name="value">Params["<xsl:value-of select="concat( 'search_', @name)"/>"]</xsl:with-param>
</xsl:call-template>;
}
</xsl:otherwise>
PropertyBag["<xsl:value-of select="concat( 'search_', @name)"/>"] = Params[ "<xsl:value-of select="concat( 'search_', @name)"/>"];
withSearchCriteria = true;
}
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:for-each select="adl:property[@distinct='user' or @distinct='all']">
@ -768,8 +771,15 @@
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 ( ! withSearchCriteria) {
showRecords = <xsl:value-of select="$records-per-page"/>;
}
PropertyBag["instances"] =
PaginationHelper.CreatePagination( this, instances, <xsl:value-of select="$records-per-page"/>);
PaginationHelper.CreatePagination( this, instances, showRecords);
RenderViewWithFailover(view + ".vm", view + ".auto.vm");
}