Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

PortalWebHosting
  Ads  
Biz Modules provides professional business modules and solutions for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  User Defined Ta...  How can I make Search work with the CardView?
Previous Previous
 
Next Next
New Post 5/5/2008 10:21 PM
User is offline James Hall
82 posts
10th Ranked




Re: How can I make Search work with the CardView? 
Search with CardView or a Cardview like presentation is something we need right now, Any suggestions?
 
New Post 5/5/2008 10:38 PM
User is offline Stefan Cullmann
1553 posts
5th Ranked








Re: How can I make Search work with the CardView? 

As said before: merge both XSL ctylesheets or use a custom script using generate script.


Stefan Cullmann - stefan.cullmann [at] dotnetnuke.com
form and List will be the successor of the User Defined Table module.
----------------------------------------------------------------------
Do you want to import external data to form and List /User Defined Table?
Check out http://www.codeplex.com/Csv2UDTImport
 
New Post 5/5/2008 10:46 PM
User is offline James Hall
82 posts
10th Ranked




Re: How can I make Search work with the CardView? 

But I'll still have the limitation of case sensitivity. Correct?

 
New Post 5/5/2008 10:54 PM
User is offline Stefan Cullmann
1553 posts
5th Ranked








Re: How can I make Search work with the CardView? 

Yes. This require a some more code changes. It is already checked into the repository.

Currently UDT is forked - while Sebastian is still supporting UDT3.x, I am working on the Next Generation UDT which will be DNN Cambrian only.


Stefan Cullmann - stefan.cullmann [at] dotnetnuke.com
form and List will be the successor of the User Defined Table module.
----------------------------------------------------------------------
Do you want to import external data to form and List /User Defined Table?
Check out http://www.codeplex.com/Csv2UDTImport
 
New Post 5/8/2008 6:48 PM
User is offline ajsansone
183 posts
www.graphicsphere.net/
9th Ranked


Re: How can I make Search work with the CardView? 
Modified By ajsansone  on 5/8/2008 8:57:46 PM)

Here's my advancedtable.xsl code I tried to merge together with my cardview.xsl code. Everything seems to be displaying properly but search doesn't work. I can't figure out why search isn't working because there are no errors to troubleshoot in xsl. I'm very close but can't seem to find the little snippet of code that is not making it work. 

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:udt="DotNetNuke/UserDefinedTable">
  <xsl:output method="xml" version="1.0" indent="yes" omit-xml-declaration="yes" />

  <!--
  ****************************************************************************************
  Global variables and parameters
  ****************************************************************************************
  -->
 
  <!--(querystring udt_) parameter-->
  <xsl:param name="param_search" />
  <xsl:param name="param_searchpostback" />
  <xsl:param name="param_ispostback" />
  <xsl:param name="param_page" select="1" />
  <xsl:param name="param_detail" />
  <xsl:param name="param_orderby" select="//udt:Fields[udt:UserDefinedFieldId=//udt:Context/udt:OrderBy]/udt:SortColumn"/>
  <xsl:param name="param_direction" select="//udt:Context/udt:OrderDirection"/>
  <xsl:variable name="paging" select="//udt:Context/udt:Paging" />
 
  <!--
  This prefix is used to generate module specific query strings
  Each querystring or form value that starts with udt_{ModuleId}_param
  will be added as parameter starting with param
  -->
  <xsl:variable name="prefix_param">udt_<xsl:value-of select="//udt:Context/udt:ModuleId"/>_param</xsl:variable>

  <!--wrong string would break stylesheet, so fallback to ascending if userinput is wrong-->
  <xsl:variable name="orderDirection">
    <xsl:choose>
      <xsl:when test="$param_direction='descending'">
        <xsl:text>descending</xsl:text>
      </xsl:when>
      <xsl:otherwise>
        <xsl:text>ascending</xsl:text>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>

  <xsl:variable name="orderType">
    <xsl:variable name="DataType" select="//udt:Fields[udt:SortColumn=$param_orderby]/udt:FieldType" />
    <xsl:choose>
      <xsl:when test="$DataType='Int32' or $DataType='Decimal' or $DataType='Currency'">number</xsl:when>
      <xsl:otherwise>text</xsl:otherwise>
    </xsl:choose>
  </xsl:variable>

  <!--search-->
  <xsl:variable name="search">
    <xsl:choose>
      <xsl:when test="$param_ispostback">
        <xsl:value-of select="$param_searchpostback" />
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$param_search" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>

  <xsl:template name="sortingArrow">
    <img src="{//udt:Context/udt:ApplicationPath}/images/sort{$orderDirection}.gif" border="0" />
  </xsl:template>
 
  <xsl:template name="searchform">
  <div align="center">
    <input type="text" name="{$prefix_param}_searchpostback" value="{$search}" />
    <input type="submit" name="go" value="{//udt:Context/udt:LocalizedString_Search}" />
    <input type="hidden" name="{$prefix_param}_ispostback" value="true" /><br />
  </div>
  </xsl:template>

  <xsl:template name="detailLink">
    <xsl:param name="id" />
    <a href="?{$prefix_param}_detail={$id}">
      <img border="0" alt="detail" src="{//udt:Context/udt:ApplicationPath}/images/view.gif" />
    </a>
  </xsl:template>

  <xsl:template name="editLink">
    <xsl:if test="udt:Data[udt:UserDefinedRowId=$param_detail]/udt:EditLink">
      <a>
        <xsl:attribute name="href">
          <xsl:value-of select="udt:Data[udt:UserDefinedRowId=$param_detail]/udt:EditLink" />
        </xsl:attribute>
        <img border="0" alt="edit">
          <xsl:attribute name="src">
            <xsl:value-of select="//udt:Context/udt:ApplicationPath" />/images/edit.gif
          </xsl:attribute>
        </img>
      </a>
    </xsl:if>
  </xsl:template>

  <xsl:template name="backLink">
    <a href="{//udt:Context/udt:ApplicationPath}/tabid/{//udt:Context/udt:TabId}/Default.aspx">
      <img border="0" alt="Back" src="{//udt:Context/udt:ApplicationPath}/images/lt.gif" />
    </a>
  </xsl:template>
 
  <!--
  ****************************************************************************************
  Card View with Search Variables
  ****************************************************************************************
  -->
 
  <xsl:template match="/udt:UserDefinedTable">
    <xsl:choose>
      <xsl:when test="$param_detail">
        <xsl:call-template name="detailView" />
      </xsl:when>
      <xsl:otherwise>
        <!-- Sorting Support-->
        <xsl:variable name="columncount" select="count(udt:Fields[udt:Visible='true']/udt:FieldTitle)+1" />
        <xsl:variable name="searchColumns" select="//udt:Fields[udt:Searchable='true']/udt:ValueColumn" />
        <xsl:variable name="filteredData" 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][6],$search)or contains(*[name()=$searchColumns][7],$search)or contains(*[name()=$searchColumns][8],$search)or contains(*[name()=$searchColumns][9],$search)or contains(*[name()=$searchColumns][10],$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($filteredData)+1" />
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <table cellspacing="0" cellpadding="4" border="0" style="border-width:0px;border-collapse:collapse;">
          <xsl:if test ="//udt:Fields[udt:Searchable='true']">
          <tr>
            <td colspan="{$columncount}" align="left">
              <xsl:call-template name="searchform" />
            </td>
          </tr>
          </xsl:if>
          <tr class="NormalBold UDT_Table_Head">
            <th />
            <xsl:variable name ="imgColumn" select="//udt:Fields[udt:FieldType='Image'][1]/udt:ValueColumn"/>
   <xsl:variable name ="titleColumn" select="//udt:Fields[udt:FieldType='String'][1]/udt:ValueColumn"/>
   <xsl:variable name ="htmlColumn" select="//udt:Fields[udt:FieldType='TextHtml'][1]/udt:ValueColumn"/>
   <xsl:variable name ="currencyColumn" select="//udt:Fields[udt:FieldType='Currency'][1]/udt:ValueColumn"/>
   <xsl:for-each select="udt:Data">
   <xsl:variable name="id" select="udt:UserDefinedRowId"/>
  <div align="center"><br />
    <table style="border: silver 1px solid;" width="420" border="0" cellspacing="0" cellpadding="7">
      <tr>
        <td><table cellspacing="0" cellpadding="7"  border="0"  style="border-width:0px;border-collapse:collapse;">
  <tr class="normal">
   <td>
    <h2><xsl:value-of select="//udt:Data[udt:UserDefinedRowId=$id]/*[name()=$titleColumn]" disable-output-escaping="yes"/></h2>
    <xsl:value-of select="//udt:Data[udt:UserDefinedRowId=$id]/*[name()=$htmlColumn]" disable-output-escaping="yes"/>
   </td>
  </tr>
    </table></td>
      </tr>
      <tr>
        <td><table cellspacing="0" cellpadding="7"  border="0" style="border-width:0px;border-collapse:collapse;">
        <tr class="normal">
            <td valign="middle">
    <xsl:if test="udt:EditLink">
     <a>
      <xsl:attribute name="href">
       <xsl:value-of select="udt:EditLink" />
      </xsl:attribute>
      <img border="0" alt="edit">
       <xsl:attribute name="src">
        <xsl:value-of select="//udt:Context/udt:ApplicationPath"/>/images/edit.gif</xsl:attribute>
      </img>
     </a>
    </xsl:if>
   </td>
   <td valign="middle">
    <xsl:value-of select="//udt:Data[udt:UserDefinedRowId=$id]/*[name()=$imgColumn]" disable-output-escaping="yes"/>
   </td>
         <td>
             <table cellspacing="7" cellpadding="0" border="0">
     <xsl:for-each select="//udt:Fields">   
      <xsl:variable name="NameOfValueColumn" select="udt:ValueColumn"/>
      <xsl:variable name="CurrentValue" select="//udt:Data[udt:UserDefinedRowId=$id]/*[name()=$NameOfValueColumn]"/>
      <xsl:if test ="$CurrentValue and $CurrentValue!='' and ($NameOfValueColumn!=$imgColumn or not($imgColumn)) and ($NameOfValueColumn!=$titleColumn  or not($titleColumn)) and ($NameOfValueColumn!=$htmlColumn  or not($htmlColumn))and (udt:Visible='true' or udt:Visible='True')" >
       <tr class="normal">
        <xsl:if test="(position() mod 2 = 1)">
         <xsl:attribute name="bgcolor">#FFFFFF</xsl:attribute>
        </xsl:if>
        <td class="subhead" align="left" >
         <xsl:value-of select ="udt:FieldTitle"/>:
        </td>
        <td>&#160;</td>
        <td class="normal" align="left" >
         <xsl:choose>
            <xsl:when test="udt:FieldType='Currency'">
               <xsl:value-of select='format-number($CurrentValue, "$###,##0.00")' disable-output-escaping="yes"/>
            </xsl:when>
            <xsl:when test="udt:FieldType='Int32' and udt:FieldTitle!='Year'">
               <xsl:value-of select='format-number($CurrentValue, "###,##0")' disable-output-escaping="yes"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:value-of select="$CurrentValue" disable-output-escaping="yes"/>
            </xsl:otherwise>
         </xsl:choose>           
        </td>
       </tr>
      </xsl:if>
     </xsl:for-each>
    </table><br />
            </td>
        </tr>
    </table></td>
      </tr>
    </table>
  </div>
<br />
</xsl:for-each>         
          </tr>         
        </table>
        <xsl:if test="$paging">
          <xsl:call-template name="renderPaging">
            <xsl:with-param name="maxPages" select="ceiling(count($filteredData) div $paging)" />
          </xsl:call-template>
        </xsl:if>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
 
  <!--
  ****************************************************************************************
  Detail View with All Variables
  ****************************************************************************************
  -->
 
  <xsl:template name="detailView">
    <table class="Normal">
      <tr>
        <td>
          <xsl:call-template name="backLink" />
          <xsl:call-template name="editLink" />
        </td>
      </tr>
      <xsl:for-each select="udt:Fields">
        <xsl:if test="udt:FieldType!='ChangedAt' and udt:FieldType!='ChangedBy' and udt:FieldType!='CreatedAt' and udt:FieldType!='CreatedBy'">
          <xsl:variable name="NameOfValueColumn" select="udt:ValueColumn" />
          <xsl:if test="//udt:Data[udt:UserDefinedRowId=$param_detail]/*[name()=$NameOfValueColumn]!=''">
            <tr>
              <th class="NormalBold UDT_Table_Head" align="left">
                <xsl:value-of select="udt:FieldTitle" />:
              </th>
              <td>
                <xsl:value-of select="//udt:Data[udt:UserDefinedRowId=$param_detail]/*[name()=$NameOfValueColumn]" disable-output-escaping="yes" />
              </td>
            </tr>
          </xsl:if>
        </xsl:if>
      </xsl:for-each>
    </table>
    <hr color="orange" />
    <table style="font-size:smaller;width:100%;align:center">
      <tr>
        <th class="NormalBold UDT_Table_Head" style="font-size:smaller;">
          <xsl:value-of select="//udt:Fields[udt:FieldType='ChangedAt']/udt:FieldTitle" />:
        </th>
        <td class="Normal" style="font-size:smaller;">
          <xsl:value-of select="//udt:Data[udt:UserDefinedRowId=$param_detail]/*[name()=//udt:Fields[udt:FieldType='ChangedAt']/udt:ValueColumn]" disable-output-escaping="yes" />
        </td>
        <th class="NormalBold UDT_Table_Head" style="font-size:smaller;">
          <xsl:value-of select="//udt:Fields[udt:FieldType='ChangedBy']/udt:FieldTitle" />:
        </th>
        <td class="Normal" style="font-size:smaller;">
          <xsl:value-of select="//udt:Data[udt:UserDefinedRowId=$param_detail]/*[name()=//udt:Fields[udt:FieldType='ChangedBy']/udt:ValueColumn]" disable-output-escaping="yes" />
        </td>
      </tr>
      <tr>
        <th class="NormalBold UDT_Table_Head" style="font-size:smaller;">
          <xsl:value-of select="//udt:Fields[udt:FieldType='CreatedAt']/udt:FieldTitle" />:
        </th>
        <td class="Normal" style="font-size:smaller;">
          <xsl:value-of select="//udt:Data[udt:UserDefinedRowId=$param_detail]/*[name()=//udt:Fields[udt:FieldType='CreatedAt']/udt:ValueColumn]" disable-output-escaping="yes" />
        </td>
        <th class="NormalBold UDT_Table_Head" style="font-size:smaller;">
          <xsl:value-of select="//udt:Fields[udt:FieldType='CreatedBy']/udt:FieldTitle" />:
        </th>
        <td class="Normal" style="font-size:smaller;">
          <xsl:value-of select="//udt:Data[udt:UserDefinedRowId=$param_detail]/*[name()=//udt:Fields[udt:FieldType='CreatedBy']/udt:ValueColumn]" disable-output-escaping="yes" />
        </td>
      </tr>
    </table>
  </xsl:template> 
 
  <xsl:template name="pagingSinglePages">
    <!--renders paging links-->
    <xsl:param name="pageNumber" select="1" />
    <xsl:param name="maxPages" select="ceiling(count(//udt:Data) div $paging)" />
    <xsl:choose>
      <xsl:when test="$param_page=$pageNumber">
        <span class="NormalDisabled">
          [<xsl:value-of select="$pageNumber" />]
        </span>
      </xsl:when>
      <xsl:otherwise>
        <a href="?{$prefix_param}_page={$pageNumber}&amp;{$prefix_param}_search={$search}&amp;{$prefix_param}_orderby={$param_orderby}&amp;{$prefix_param}_orderDirection={$orderDirection}" class="CommandButton">
          <xsl:value-of select="$pageNumber" />
        </a>
      </xsl:otherwise>
    </xsl:choose>&#160;
    <xsl:if test="$pageNumber &lt; $maxPages">
      <xsl:call-template name="pagingSinglePages">
        <xsl:with-param name="pageNumber" select="$pageNumber +1" />
        <xsl:with-param name="maxPages" select="$maxPages"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>

  <xsl:template name="renderPaging">
    <xsl:param name="maxPages" select="ceiling(count(//udt:Data) div $paging)" />
    <xsl:variable name="previous" select="$param_page - 1" />
    <xsl:variable name="next" select="$param_page + 1" />
    <table class="PagingTable" bordercolor="Gray" border="0" style="border-color:Gray;border-width:1px;border-style:Solid;width:100%;">
      <tr>
        <td class="Normal" align="Left">
          <xsl:value-of select ="//udt:Context/udt:LocalizedString_Page"/>&#160;<xsl:value-of select="$param_page"/>&#160;<xsl:value-of select ="//udt:Context/udt:LocalizedString_Of"/>&#160;<xsl:value-of select="$maxPages"/>
        </td>
        <td class="Normal" align="Right" >
          <xsl:choose>
            <xsl:when test="$param_page&gt;1">
              <a href="?{$prefix_param}_search={$search}&amp;{$prefix_param}_orderby={$param_orderby}&amp;{$prefix_param}_orderDirection={$orderDirection}" class="CommandButton">
                <xsl:value-of select ="//udt:Context/udt:LocalizedString_First"/>
              </a>
            </xsl:when>
            <xsl:otherwise>
              <span class="NormalDisabled">
                <xsl:value-of select ="//udt:Context/udt:LocalizedString_First"/>
              </span>
            </xsl:otherwise>
          </xsl:choose>&#160;&#160;
          <xsl:choose>
            <xsl:when test="$param_page&gt;1">
              <a href="?{$prefix_param}_page={$previous}&amp;{$prefix_param}_search={$search}&amp;{$prefix_param}_orderby={$param_orderby}&amp;{$prefix_param}_orderDirection={$orderDirection}" class="CommandButton">
                <xsl:value-of select ="//udt:Context/udt:LocalizedString_Previous"/>
              </a>
            </xsl:when>
            <xsl:otherwise>
              <span class="NormalDisabled">
                <xsl:value-of select ="//udt:Context/udt:LocalizedString_Previous"/>
              </span>
            </xsl:otherwise>
          </xsl:choose>&#160;&#160;
          <xsl:variable name ="startpage">
            <xsl:choose>
              <xsl:when test ="$param_page&gt;5">
                <xsl:value-of select="$param_page -4"/>
              </xsl:when>
              <xsl:otherwise>1</xsl:otherwise>
            </xsl:choose>
          </xsl:variable>
          <xsl:variable name ="endpage">
            <xsl:choose>
              <xsl:when test="$startpage+9&gt;$maxPages">
                <xsl:value-of select ="$maxPages"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select ="$startpage +9"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:variable>
          <xsl:call-template name="pagingSinglePages">
            <xsl:with-param name="pageNumber" select="$startpage"/>
            <xsl:with-param name="maxPages" select="$endpage"/>
          </xsl:call-template>
          <xsl:choose>
            <xsl:when test="$param_page&lt;$maxPages">
              <a href="?{$prefix_param}_page={$next}&amp;{$prefix_param}_search={$search}&amp;{$prefix_param}_orderby={$param_orderby}&amp;{$prefix_param}_orderDirection={$orderDirection}" class="CommandButton">
                <xsl:value-of select ="//udt:Context/udt:LocalizedString_Next"/>
              </a>
            </xsl:when>
            <xsl:otherwise>
              <span class="NormalDisabled">
                <xsl:value-of select ="//udt:Context/udt:LocalizedString_Next"/>
              </span>
            </xsl:otherwise>
          </xsl:choose>&#160;&#160;
          <xsl:choose>
            <xsl:when test="$param_page&lt;$maxPages">
              <a href="?{$prefix_param}_page={$maxPages}&amp;{$prefix_param}_search={$search}&amp;{$prefix_param}_orderby={$param_orderby}&amp;{$prefix_param}_orderDirection={$orderDirection}" class="CommandButton">
                <xsl:value-of select ="//udt:Context/udt:LocalizedString_Last"/>
              </a>
            </xsl:when>
            <xsl:otherwise>
              <span class="NormalDisabled">
                <xsl:value-of select ="//udt:Context/udt:LocalizedString_Last"/>
              </span>
            </xsl:otherwise>
          </xsl:choose>&#160;&#160;
        </td>
      </tr>
    </table>
  <p class="subhead">Total Modelers: <xsl:value-of select="count(udt:Data)"/></p>
</xsl:template>
</xsl:stylesheet>


Anthony John Sansone
Graphicsphere.Net, President
Palm Harbor, Florida, U.S.A.
http://www.graphicsphere.net
View Anthony J. Sansone's profile on LinkedIn
 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  User Defined Ta...  How can I make Search work with the CardView?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Perpetual Motion Interactive Systems Inc.
A solutions company specializing in Microsoft enterprise technologies.
www.perpetualmotion.ca
Icthus Technologies
Building Faith on the Internet
www.icthustech.com
Efficion Consulting
A premier DotNetNuke consulting firm providing complete DNN services including: custom module development, skinning and design, installation and integration services.
www.efficionconsulting.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP