ADF 中OnClick的JavaScript的支持问题
ADF 11g不再支持Onclick等JavaScript,而是采用<af:clientListener>来实现诸如删除某条记录的提示框。
实现方式如下:
function confirmDelete() {
if (confirm('Are you sure you want to delete this record?'))
return true;
else
return false;
}
<af:commandLink actionListener="#{bindings.removeRowWithKey.execute}"
action="#{viewCalStatus.deleteCalStatus}" text="Delete">
<af:clientListener method="confirmDelete" type="click"/>
<af:setActionListener from="#{row.rowKeyStr}" to="#{requestScope.calStatusRow}"/>
</af:commandLink>
ADF 中的<af:commandLink>和<af:commandButton>传递参数的方法
<af:commandLink id= “” text= “”><f:param name= “param_name” value= “param_value”/></ af:commandLink> 评论:<af:commandLink>可以采用该方法传递参数,而<af:commandButton>不行。不过可以应用<h: commandButton >代替<af:commandButton>实现参数传递。具体方法如下: <h:commandButton value="更新" action="#{emplBean.edit_action}" id="cb1"> <input type="hidden" name="emplId" value="${emplBean.employee.empno}"/></h:commandButton>
相关文档:
引自:http://blog.csdn.net/lsj19830812/archive/2007/10/25/1843578.aspx
a.jsp是要打印的页面
<html>
<head>
<script language="javascript">
function fmtPrint(printPlace,w,h){
var sarg=new Array();
var sdata=document.all.item(printPlace);
sarg[0]=s ......
Js代码
<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="wmp" >
<param name="URL" value="" /> ......
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>JS调用现成Word模板完成打印</title>
<script type="text/javascript">
//转换word的函数
function ......