2011-08-03 60 views
2

jspに次のコードがあります。イテレータを使用したstruts2テーブルでは、別の行のチェックボックスが表示されます

<table> 
    <tr> 
     <s:if test="%{#session['s_userRole']=='Supervisor'}"> 
      <th>Select</th> 
     </s:if> 
     <th>Job ID</th> 
     <th>Upload Date</th> 
     <th>File Name</th> 
     <th>Status</th> 
     <th>Notes</th> 
    </tr> 
    <s:iterator value="jobs"> 
     <tr> 
      <s:if test="%{#session['s_userRole']=='Supervisor'}"> 
       <td><s:checkbox name="check" /></td> 
      </s:if> 
      <td><s:property value="jobId" /></td> 
      <td><s:property value="uploadDate" /></td> 
      <td><a href=fileName><s:property value="fileName" /> </a></td> 
      <td><s:property value="status" /></td> 
      <td><a href='javascript:onClick=alert("Note goes here")'>View 
        Note</a></td> 

     </tr> 
    </s:iterator> 
</table> 

ただし、チェックボックスは別の行に表示されます。どのように私はそれを同じ行に持っていくのですか?

答えて

6

これは、デフォルトのテーマに基づいてStruts2のデフォルトのレンダリングが行われたためです。あなたがしようと、それはデフォルトのテンプレートを使用してレンダリングしたくない場合はhttp://www.mkyong.com/struts2/working-with-struts-2-theme-template/

<s:checkbox name="check" theme="simple"/>

1

ちょうど

<s:form theme="simple"></s:form> 
を入れて、私はこのチュートリアルでは、Struts2ののテーマ/テンプレートの良いアイデアを与える見つけます
関連する問題