我正在使用單選按鈕列表,在頁面(代表城市)中選擇單選按鈕時,我需要在XSLT Sitecore中顯示城市中的單位列表。在此處我可以看到外部webservice的機構列表,所以我需要作爲城市的唯一ID(存儲爲單選按鈕的值)傳遞給webservice。下面是我用來做同樣的代碼。使用Sitecore中的單選按鈕列表XSLT
<xsl:variable name="city" select="sc:GetCityUniqueID()"/>
<xsl:variable name="ID" select="sc:item($city,.)" />
<table cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<!--In the SiteCore Content Tree we are maintaining Institutions as Child Nodes to Cities.So using for each I am populating radio buttons with those many institutions under a city.Here Please note that I am setting Value to the ID which I need to pass to the Helpwr Function sc:GetInstitutions below-->
<xsl:variable name="cities" select="$content/child::item[@template='city institution details']"/>
<xsl:if test="$cities " >
<xsl:for-each select="$icities" >
<xsl:variable name="current" select="."></xsl:variable>
<input type="radio" Groupname="citylist">
<xsl:attribute name="id" >
city<xsl:value-of select="position()"/>
</xsl:attribute>
<xsl:attribute name="name" >city</xsl:attribute>
<xsl:attribute name="value" >
<sc:text field="Institute ID" select="$current" />
</xsl:attribute>
</input>
<span class="chooseCity">
<sc:text field="Name" select="$current" />
</span>
<br/>
</xsl:for-each>
</xsl:if>
</td>
</tr>
</table>
<div class="institution_results">
Institutions are:
</div>
<div class="paddAll">
<!--Here 123456 should be the selected radio buttons value above,which I am passing to external webservice call done in the helper to populate Institutions-->
<xsl:value-of select="sc:GetInstitutions('123456’)" disable-output-escaping="yes"/>
</div>
我面對這裏的問題是我怎麼能選擇的單選按鈕值傳遞給XSL助手功能得到機構的名單,並顯示如下頁面的結果。
任何建議將有幫助。