我正在处理单选按钮列表,在页面中选择单选按钮(代表城市)时,我需要在 XSLT Sitecore 中显示城市中的机构列表。这里我从外部网络服务获取机构列表,所以我需要作为城市的唯一 ID(存储为单选按钮的值)传递给 Web 服务。下面是我用来做同样事情的代码。
<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 Helper 函数以获取机构列表并在下面的同一页面中显示结果。
任何建议都会有所帮助。