2017-02-23 15 views
0

我想知道是否在引導形式下創建struts2 <s:checkbox>。請看看我的jsp代碼。複選框不會出現。它顯示瞭如果我創建一個複選框像輸入類型=「複選框」的正常方式,但我必須使用struts2標籤來創建它,以便能夠使用struts2操作來處理表單。可以使用Bootstrap創建Struts2複選框嗎?

JSP

<s:form action="exportDocumentExport" namespace="/esignmain/documentExport" name="documentExportForm" theme="bootstrap" cssClass="form-vertical"> 
     <%-- Message --%> 
     <div class="message"> 
      <s:if test="message != null"> 
       <strong style="color:#7F0E11"><s:property value="message"/></strong> 
      </s:if> 
     </div> 

    <s:if test="message == null"> 
    <div class="scrollView11"> 
     <table id="eSignUsers" class="table table-hover"> 
      <thead> 
       <tr> 
        <th><s:text name="S.NO"/></th> 
        <th><s:text name="Document identifier"/></th> 
        <th><s:text name="Name"/></th> 
        <th><s:text name="Description"/></th> 
        <th><s:text name="Active"/></th>    
       </tr> 
      </thead> 
      <tr> 
       <s:iterator value="documentList" status="status"> 
        <tbody> 
         <tr>  
          <td><s:property value="#status.count" /></td> 
          <td><s:property value="identifier" /></td> 
          <td><s:property value="name" /></td> 
          <td><s:property value="description" /></td> 
          <td><s:property value="active" /></td> 
          <td><s:checkbox name="checked" fieldValue="%{id}" value="false"/></td> 
         </tr>  
        </tbody>         
       </s:iterator> 
      </tr> 
      <tr> 
       <table class="table table-striped"> 
        <tr> 
         <h5>Showing <span id="totalRows" class="label label-success"></span> total records</h5> 
         <s:submit key="Export Document" value="Export Document" type="button" class="btn btn-sm btn-success" name="Export_Document" theme="simple" onclick="return evalGroup()"><span class="glyphicon glyphicon-export"></span> Export</s:submit> 
        </tr> 
       </table> 
      </tr> 
    </table> 
</div> 

感謝

+0

後的代碼,以顯示你是如何引導一個複選框 –

+0

請,精心 –

+0

我已經更新了我的問題。 – Mike

回答

1

我猜你想創建一個使用<s:checkbox>

試試這個Bootstrap -styled複選框:

<div class="checkbox"> 
    <label> 
    <s:checkbox name="..."/> 
    Your label here 
    </label> 
</div> 
+0

它不起作用,我已經試過這種方法。 – Mike

+0

@Mike \t定義「它不起作用」。 –

+0

我的意思是我沒有看到任何複選框,因爲s:複選框標記。 – Mike