【发布时间】:2016-03-11 14:55:34
【问题描述】:
我的动作类中有如下对象列表。
private ArrayList<Employee> emp_list;
public ArrayList<Employee> getEmp_list() {
return emp_list;
}
public void setEmp_list(ArrayList<Employee> emp_list) {
this.emp_list = emp_list;
}
Bean 类:(它有 getter 和 setter)
private String name;
private String designation;
private String project;
现在在 jsp 页面上,我希望将此列表数据显示为 同一页面上的弹出窗口中的表格 按钮或 href 点击(显示列表的大小)。
<body>
<div class="container">
<h2>Modal Example</h2>
<!-- Trigger the modal with a button -->
<table>
<s:iterator value="emp_list">
<tr>
<td><s:property value="name" /></td>
<td>
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Display Details</button>
</td>
</tr>
</s:iterator>
</table>
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Employee Details</h4>
</div>
<div class="modal-body">
<table>
<tr>
<td>Name</td>
<td><s:property value="name" />
</td>
</tr>
<tr>
<td>Designation</td>
<td><s:property value="designation" />
</td>
</tr>
<tr>
<td>Project</td>
<td><s:property value="project" />
</td>
</tr>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</body>
请帮帮我,我卡在这里了。
【问题讨论】:
-
我不确定是什么问题。这不就是简单的jQuery或者插件用法吗?
-
你尝试了什么?它是弹出窗口还是同一页面上的弹出窗口?
-
是的 Roman,你是对的,我需要在同一页面上弹出表格,但不知道如何实现它
-
但是你没有告诉我们你卡在哪里了。
标签: jsp struts2 struts2-jquery-plugin struts2-bootstrap-plugin