Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListSelect + Search throws errorSelect + Search throws error
Previous
 
Next
New Post
12/29/2008 9:10 AM
 

I have multiple instances of the my table showing different record sets by filtering one of more fields.  I want users to be able to search within each data subset.

I use the search code generated by the XSL generator, and it works fine. But when I add the filter, I get the dreaded 'transformation failed' error. I can comment out the search code block and the filtered data displays correctly. Or, I can comment out the filter and the searching works right.  But I can't get the two functions to play nice together in one module.

An example of my filter (which works fine if I do not also have searching):  

<xsl:variable name="currentData" select="udt:Data[contains(udt:Display,'Yes') and contains(udt:SaleType,'REO')]" />

I am placing my filter inside the  <xsl:template match="/udt:UserDefinedTable"> tags.  Could that be the problem? If so, where should the tag be placed?
 

Thanks.

-Michael

 

 
New Post
12/30/2008 5:01 AM
 

Michael, are you declaring the variable currentData twice? Plese post an example that throws the error.

Also please go to Adminstrator-> Events and look up the inner XSLT exception message. 

 

 
New Post
12/30/2008 6:26 AM
 

Yes, I see that I am declaring the variable twice.  But I don't know XSL well enough to know how to re-form the code block. I tried re-naming each of the variables alternately, which does not give an error but then the filter or search fails.

(Red is what I wanted to add to create the "default" dataset for the module, Blue is what the XSL generator produced).

************
  <xsl:template match="/udt:UserDefinedTable">
    <xsl:variable name="currentData" select="udt:Data[contains(udt:Display,'Yes') and contains(udt:SaleType,'REO')]" />
    <xsl:variable name="searchColumns" select="//udt:Fields[udt:Searchable='true']/udt:ValueColumn" />
    <xsl:if test="//udt:Fields[udt:Searchable='true']">
      <xsl:call-template name="Searchform" />
    </xsl:if>
    <xsl:variable name="currentData" select="udt:Data[contains(*[name()=$searchColumns][1],$search) or contains(*[name()=$searchColumns][2],$search) or contains(*[name()=$searchColumns][3],$search) or contains(*[name()=$searchColumns][4],$search) or contains(*[name()=$searchColumns][5],$search) or contains(*[name()=$searchColumns][24],$search) or contains(*[name()=$searchColumns][25],$search) or contains(*[name()=$searchColumns][26],$search) or contains(*[name()=$searchColumns][27],$search) or contains(*[name()=$searchColumns][28],$search) or contains(*[name()=$searchColumns][29],$search) or contains(*[name()=$searchColumns][22],$search) or contains(*[name()=$searchColumns][23],$search)]" />
    <xsl:variable name="from">
      <xsl:choose>
        <xsl:when test="$paging">
          <xsl:value-of select="$paging * $param_page - $paging" />
        </xsl:when>
        <xsl:otherwise>0</xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:variable name="to">
      <xsl:choose>
        <xsl:when test="$paging">
          <xsl:value-of select="$paging * $param_page +1" />
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="count($currentData)+1" />
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <table>
      <xsl:apply-templates select="$currentData" mode="list">
        <xsl:sort select="*[name()=$orderBy]" order="{$orderDirection}" data-type="{$orderType}" />
        <xsl:with-param name="from" select="$from" />
        <xsl:with-param name="to" select="$to" />
      </xsl:apply-templates>
    </table>
    <xsl:if test="$paging">
      <xsl:call-template name="renderPaging">
        <xsl:with-param name="maxPages" select="ceiling(count($currentData) div $paging)" />
      </xsl:call-template>
    </xsl:if>
  </xsl:template>
***********************

Thanks for your help.

-M

 
New Post
12/30/2008 6:34 AM
 

OH, and also, the error does not record an event, but displays the following at the top of the module and then renders the data in the default grid.

XSL Tranformation failed. Switched back to Default Grid Table.
StyleSheet:/Portals/0/XslStyleSheets/Listings_REO1a.xsl
Error Description:XSLT compile error at file:///f:/HostingSpaces/bhdcom/besthomediscounts.com/wwwroot/Portals/0/XslStyleSheets

-M

 
New Post
12/30/2008 6:02 PM
 

Just what I thought on the first place, you defined currentData twice, see my proposal for a fix::

<xsl:template match="/udt:UserDefinedTable">
    <xsl:variable name="currentFilteredData" select="udt:Data[contains(udt:Display,'Yes') and contains(udt:SaleType,'REO')]" />
    <xsl:variable name="searchColumns" select="//udt:Fields[udt:Searchable='true']/udt:ValueColumn" />
    <xsl:if test="//udt:Fields[udt:Searchable='true']">
      <xsl:call-template name="Searchform" />
    </xsl:if>
    <xsl:variable name="currentData" select="
$currentFilteredData[contains(*[name()=$searchColumns][1],$search) or contains(*[name()=$searchColumns][2],$search) or contains(*[name()=$searchColumns][3],$search) or contains(*[name()=$searchColumns][4],$search) or contains(*[name()=$searchColumns][5],$search) or contains(*[name()=$searchColumns][24],$search) or contains(*[name()=$searchColumns][25],$search) or contains(*[name()=$searchColumns][26],$search) or contains(*[name()=$searchColumns][27],$search) or contains(*[name()=$searchColumns][28],$search) or contains(*[name()=$searchColumns][29],$search) or contains(*[name()=$searchColumns][22],$search) or contains(*[name()=$searchColumns][23],$search)]" />....

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListSelect + Search throws errorSelect + Search throws error


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out