今天需要添加一个功能: 点击按钮、在mainFrame中显示值班编排表。
(是说明逻辑,不太考虑核心代码的实现)
具体步骤如下:
1.创建 事件源点击后 要显示的页面
如下行代码中的dutyList.jsp
function toOnDuty(){
window.open("../../*****/dutyList.jsp","mainFrame","");
}
2.在自定义tag库中添加tag
如在 **.tld 中添加如下代码:
引用
<tag>
<name>DutyListTag</name>
<tagclass>com.***.common.tag.***.DutyListTag</tagclass>
<bodycontent>JSP</bodycontent>
<attribute>
<name>xslUri</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<name>xslCache</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
name :引用tag时的标识
tagclass:tag.java所在的路径
3.在新建jsp页面中声明并调用tag标签库
如:
引用
<%@taglib uri="/WEB-INF/***.tld" prefix="tag"%>
<tag DutyListTag xsluri="stylesheets/****.dutyList.xsl" xslCache="true">
4.由于 dutyList.xsl 已经写好
因此在点击 浏览编排值班浏览按钮时、 列表就会在mainFrame 中显示。。
=============================================================
引用
<table id="report" name="report" border="0" style="width:97%;font-size:16px;">
<input type="hidden" name="parentidList" id="parentidList" >
<xsl:attribute name="value"><xsl:value-of select="reportParentList/parentidList" /></xsl:attribute>
</input>
<xsl:for-each select="reportParentList/reportParent">
<tr style="width:100%;">
<td style="width:100%;font-size:16px;">
<input type="radio" id="reportNumber_{position()}" name="reportNumber" value="{eventid}" onclick="passValue('{name}',{eventid})" />
<label for="reportNumber_{position()}">第<xsl:value-of select="number"/>号:<xsl:value-of select="name"/>
</label>
</td>
</tr>
</xsl:for-each>
</table>
其中:<label>标签中 for 元素 表示循环时的序号,其值应该跟radio中id的值保持相
等,否则焦点总是在循环出来的最后一个radio上,不利用操作。
=======================================================================