为什么有时浏览器无法正确显示复选框

时间:2014-05-06 14:04:53

标签: html jsf-2 browser checkbox jsf-2.2

我正在使用带有Glassfish 4服务器和https的JSF 2.2.6。我发现在Chrome浏览器或Firefox浏览器中不确定地显示了一个复选框类型。有时它显示,有些不显示。我经常发现它出现在第一个复选框上。

在生成的html页面上,我发现它显示“checked”=“已检查”正确,但在浏览器中显示未选中。

我不知道如何解决这个问题。感谢。

.xhtml代码:

<h:form id="usersF">
            <table class="table table-responsive table-bordered table-striped">
            <tr class="success" >
            <th class="text-center">#{msgs.Index}</th>
            <th class="text-center">#{adminMsgs.Username}</th>
            <th class="text-center">#{msgs.Email}</th>
            <th class="text-center">#{adminMsgs.Validity}</th>
            <th class="text-center">#{adminMsgs.LastLogin}</th>
            </tr>
           <tbody>
            <ui:repeat id="usersTable" value="#{usersManagedBean.dtmdl}" var="users"   
                                                                   varStatus="status">
              <tr>
              <td class="text-center">#{status.index+usersManagedBean.pagination.currentPage*usersManagedBean.pageSize+1}</td>   
             <td >
            <h:link id="cedit1" value="#{users.username}" outcome="adminUserDetails">
             <f:param  name="userName" value="#{users.username}"/> 
            </h:link>
            <h:outputText value="  "/>
            </td>  
            <td>#{users.email}</td>
            <td class="text-center">
            <input type="checkbox" jsf:id="user#{status.index}" jsf:value="#{users.validity}" />
             </td>
             <td> #{users.lastLoginDate} </td>
            </tr>
          </ui:repeat>
          </tbody>
         </table>
    ...
    <h:selectOneMenu id="pageSize"  class=" btn"   value="#{usersManagedBean.pageSize}">
        <f:selectItems  id="pageSizeValue" value="#{usersManagedBean.page}" var="pg"
                                                                    itemLabel="#{pg}" 
                                                                    itemValue="#{pg}"/>
        <f:ajax  execute="pageSize pageSizeValue" listener="#{usersManagedBean.recreatePageSize}" render="usersF"/>
     </h:selectOneMenu>
    </h:form>


Generated html code (shown at browser):

      <tbody>
       <tr>
       <td class="text-center">1</td>   
      <td><a id="usersF:usersTable:0:cedit1" name="usersF:usersTable:0:cedit1" href="/jsfBootstrapMV/admin/adminUserDetails.xhtml?userName=admin">admin</a>  
        </td>  
      <td>
     </td>
     <td class="text-center"><input id="usersF:usersTable:0:user" name="usersF:usersTable:0:user" checked="checked" type="checkbox" />
     </td>
      <td> Mon May 05 22:12:08 ICT 2014</td>
     </tr>
     <tr>
    <td class="text-center">2</td>   
     <td><a id="usersF:usersTable:1:cedit1" name="usersF:usersTable:1:cedit1" href="/jsfBootstrapMV/admin/adminUserDetails.xhtml?userName=sarawut">sarawut</a>  
         </td>  
         <td>
      </td>
     <td class="text-center"><input id="usersF:usersTable:1:user" name="usersF:usersTable:1:user" checked="checked" type="checkbox" />
      </td>
     <td> Tue May 06 19:34:38 ICT 2014
      </td>
     </tr>
    </tbody>

0 个答案:

没有答案