弹出拟态对话框步骤
来源:互联网 发布:嵌入式软件开发团队 编辑:程序博客网 时间:2024/05/17 07:18
一、jsp页面
//添加预警信息
function doAdd() {
var url="${base}/alarm/doAdd.shtml?time="+new Date();
var str=window.showModalDialog(url,"","location:No;status:No;help:No;dialogWidth:900px;dialogHeight:270px;");
if("Y"==str){
onClickQuery();
}
}
二、java后台
//**
* 初始化增加
* @return
* @throws Exception
*/
@Action(value = "/alarm/doAdd", results = { @Result(name = "doAdd", location = "/WEB-INF/pages/alarm/alarm_add.jsp") })
public String doAdd()throws Exception{
frameInit();//初始化下拉框
return "doAdd";
}
/**
* 绕过Template,直接输出内容的简便函�?
*/
protected void render(String text, String contentType) {
try {
HttpServletResponse response = ServletActionContext.getResponse();
response.setContentType(contentType);
response.getWriter().write(text);
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
}
/**
* 直接输出字符�?
*/
protected void renderText(String text) {
render(text, "text/plain;charset=UTF-8");
}
三、对话框页面
//添加预警信息
function addAlarm() {
if(!checkElemment()){
return;
}
if (confirm("确定新增该预警么?")) {
$.ajax({
url:"${base}/alarm/addAlarm.shtml",
data:$("#form1").serialize(),
async:false,
type: "post",
cache : false,
success:function(data){
if("Y" != data){
alert("新增失败!");
}else{
alert("新增成功");
window.returnValue=data;
window.close();
}
}
});
}
}
附:截取字符串
<td title="${department12315.departmentName }">
<s:if test="department12315.departmentName.length() > 10" >
<s:property value="department12315.departmentName.substring(0,10).concat(\"...\")"/>
</s:if>
<s:else>
<s:property value="department12315.departmentName"/>
</s:else>
<s:hidden value="department12315.id"></s:hidden>
</td>
- 弹出拟态对话框步骤
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 黑马程序员——java基础学习(集合)
- jqgrid 点击父表行时 打开子表(subgrid)
- CodeWarrior 编译程序连接有误
- 3.2. Verifying the downloaded release
- 世界时区英文缩写一览表
- 弹出拟态对话框步骤
- 正则表达式30分钟入门教程
- 如何在Excel中添加单元格菜单选项
- 计算机何中常用的函数及一些精度的简单处理
- thinkphp树形菜单
- JAVA中采用相对路径读取文件
- 我为什么喜欢编程?
- Spring注释学习 几步走
- 创业赚大钱者的九大综合素质