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>
相关文档:
JavaScript CSS Style属性对照表
文章来源:http://www.phplamp.org/2008/10/jsavscript-js-css-style/
为了达到某种特殊的效果我们需要用Javascript动态的去更改某一个标签的Css属性。比如:鼠标经过一个图片时我们让图片加一个边框,代码可能是这样:
JavaScript代码
<script type="text/javascript"> & ......
1.使用 使用Response.Write,这种方法会把JS代码写在页面的最顶部(的前面):
2. 使用: page.ClientScript.RegisterStartupScript(); 这种方法会把JS代码嵌入在页面的底部、表单的最后 (前面),适用于要在页面控件加载完成后运行的JS代码
3.使用RegisterClientScriptBlock();这种方法会把JS代码嵌入在页面的顶部、 ......
js验证表单大全
1. 长度限制
<script>
function test()
{
if(document.a.b.value.length>50)
{
alert("不能超过50个字符!");
document.a.b.focus();
return false;
}
}
</script>
<form name=a onsubmit="return test()">
<textarea name="b" cols="40" wrap="VIRTUAL" rows="6"&g ......
1.如何获取表单<select>域的选择部分的文本?
<form name="a">
<select name="a" size="1" onchange="_sel(this)">
<option value="a">1</option>
<option value="b">2</option>
<option value="c">3</option>
</select>
</form&g ......
我们常常在编写Java程序时会用到Properties文件,把一些Message等信息放在Properties文件,但是我们看到的都是一些编码。
Struts1.1b2的例子中的本国资源文件经过Unicode编码的,所以你如果要和它的运行一样,也必须将你的ApplicationResources_zh进行Unicode编码。有以下两种方法:
①使用jdk的native2ascii工具。 ......