Top > SAStrutsあれこれ > 「データベースを使ったサンプル」を軽く改造(3)

Everything is expanded.Everything is shortened.
  1
 
    public String[]         delete_checks = new String[0];

Everything is expanded.Everything is shortened.
  1
  2
  3
-
|
!
    public int deleteIgnoreVersion(Employee emp) {
        return this.jdbcManager.delete(emp).ignoreVersion().execute();
    }

Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
  8
  9
 
-
-
|
|
|
!
|
!
    @Execute(validator = false)
    public String delete() {
        for( String delete_id : employeeForm.delete_checks ) {
            Employee emp = new Employee();
            emp.id = Integer.valueOf(delete_id);
            int affectedRowNum = employeeService.deleteIgnoreVersion(emp);
        }
        return index();
    }
  • Everything is expanded.Everything is shortened.
      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
    
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    
    <%@page pageEncoding="UTF-8" %>
    <html>
    <head>
    <title>Tutorial: Employee List</title>
    <link rel="stylesheet" type="text/css" href="${f:url('/css/sa.css')}" />
    </head>
    <body>
    <h1>Tutorial: Employee List</h1>
     
    <s:form>
    <table border="1">
    <tr style="background-color:pink">
    <th>&nbsp;</th><th>Id</th><th>Name</th><th>JobType</th><th>Salary</th><th>Department</th><th>編集</th>
    </tr>
    <c:forEach var="e" varStatus="s" items="${empItems}">
    <tr style="background-color:${s.index %2 == 0 ? 'white' : 'yellow'}">
    <td><input type=checkbox name="delete_checks" value="${f:h(e.id)}"></td>
    <td align="right">${f:h(e.id)}</td>
    <td>${f:h(e.name)}</td>
    <td>${f:h(e.jobType)}</td>
    <td align="right"><fmt:formatNumber value="${e.salary}" pattern="#,##0"/></td>
    <td>${f:label(e.departmentId, deptItems, "id", "name")}</td>
    <td><s:link href="edit/${f:u(e.id)}">編集</s:link></td>
    </tr>
    </c:forEach>
    </table>
     
    <input type="submit" name="edit_for_add" value="追加" />
    <input type="submit" name="delete" value="削除"/>
    </s:form>
    </body>
    </html>

添付ファイル: fileemployee_del3.jpg 457件 [詳細] fileemployee_del2.jpg 442件 [詳細] fileemployee_del1.jpg 304件 [詳細]

リロード   新規 編集 凍結解除 差分 添付 複製 名前変更   ホーム 一覧 単語検索 最終更新 バックアップ リンク元   ヘルプ   最終更新のRSS
Last-modified: 2012-08-08 (水) 23:26:09 (2923d)