Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 3rd, 2011, 11:36 AM
Registered User
 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Select Row values from Dropdown

Hello,

While i have been in sharepoint for awhile i am not used to working with complicated XSLT. I have some premade(sharepoint designer) XSLT that out puts a drop down menu for every @Title in a list but what i am looking for is to take that selected value and return the data for that one row. for example it now returns

Code:
<div>
<select>
<option>1</option>
<option>2</option>
<option>3</option>
//etc...
</select>
</div>
This is what i want it to return
Code:
<div>
<select>
<option>1</option>
<option>2</option>
<option>3</option>
//etc...
</select>
</div>
<div>
<table>
  <tr>
    <td>Region:</td>
    <td>
      <xsl:Value-of select:"@Region">(<--for option 1 if selected)
    </td>
  </tr>
  <tr>
     <td>
      <xsl:Value-of select:"@Date">(<--for option 1 if selected)
    </td>
  </tr>
</table>
</div>
Here is my xsl so far
Code:
<XSL>
 <xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
  <xsl:output method="html" indent="no"/>
   <xsl:decimal-format NaN=""/>
   <xsl:param name="dvt_apos">'</xsl:param>
   <xsl:variable name="dvt_1_automode">0</xsl:variable>
    <xsl:template match="/">
     <xsl:call-template name="dvt_1"/>
    </xsl:template>
    <xsl:template name="dvt_1">
     <xsl:variable name="dvt_StyleName">Drpdwn</xsl:variable>
     <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" />
     <xsl:variable name="dvt_RowCount" select="count($Rows)" />
     <xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />
      <select name="ID" size="1">
       <option selected="true" value="0">Choose One...</option>
        <xsl:call-template name="dvt_1.body">
	<xsl:with-param name="Rows" select="$Rows" />
        </xsl:call-template>
      </select>
    </xsl:template>
	<xsl:template name="dvt_1.body">
	<xsl:param name="Rows" />
	<xsl:for-each select="$Rows">
               <xsl:call-template name="dvt_1.rowview" />
	</xsl:for-each>
    </xsl:template>
	<xsl:template name="dvt_1.rowview">
        <option>
	<xsl:value-of select="@Title" />
        </option>
    </xsl:template>
</xsl:stylesheet>
</XSL>
Anything you guys can help with would be welcome.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Select row in GridView WITHOUT using Select button rao965 ASP.NET 2.0 Professional 1 February 15th, 2008 10:44 AM
Displaying Records From SELECT dropdown mgordon Classic ASP Databases 12 August 3rd, 2005 12:27 PM
select value of a dropdown in a datagrid Sbartis ASP.NET 1.0 and 1.1 Professional 2 January 14th, 2005 05:19 PM
Dropdown values dotnewnewbie ASP.NET 1.0 and 1.1 Professional 5 October 28th, 2003 12:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.