久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

        <bdo id='eizF1'></bdo><ul id='eizF1'></ul>
      <tfoot id='eizF1'></tfoot>

      <small id='eizF1'></small><noframes id='eizF1'>

      <legend id='eizF1'><style id='eizF1'><dir id='eizF1'><q id='eizF1'></q></dir></style></legend>

      <i id='eizF1'><tr id='eizF1'><dt id='eizF1'><q id='eizF1'><span id='eizF1'><b id='eizF1'><form id='eizF1'><ins id='eizF1'></ins><ul id='eizF1'></ul><sub id='eizF1'></sub></form><legend id='eizF1'></legend><bdo id='eizF1'><pre id='eizF1'><center id='eizF1'></center></pre></bdo></b><th id='eizF1'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='eizF1'><tfoot id='eizF1'></tfoot><dl id='eizF1'><fieldset id='eizF1'></fieldset></dl></div>

        如何在 Struts2 中獲取特定的未選中復(fù)選框

        How to get the specifc unchecked checkboxes in Struts2(如何在 Struts2 中獲取特定的未選中復(fù)選框)

          <tbody id='d4ur9'></tbody>
        <i id='d4ur9'><tr id='d4ur9'><dt id='d4ur9'><q id='d4ur9'><span id='d4ur9'><b id='d4ur9'><form id='d4ur9'><ins id='d4ur9'></ins><ul id='d4ur9'></ul><sub id='d4ur9'></sub></form><legend id='d4ur9'></legend><bdo id='d4ur9'><pre id='d4ur9'><center id='d4ur9'></center></pre></bdo></b><th id='d4ur9'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='d4ur9'><tfoot id='d4ur9'></tfoot><dl id='d4ur9'><fieldset id='d4ur9'></fieldset></dl></div>
      1. <tfoot id='d4ur9'></tfoot>
          <bdo id='d4ur9'></bdo><ul id='d4ur9'></ul>

          <legend id='d4ur9'><style id='d4ur9'><dir id='d4ur9'><q id='d4ur9'></q></dir></style></legend>
                • <small id='d4ur9'></small><noframes id='d4ur9'>

                  本文介紹了如何在 Struts2 中獲取特定的未選中復(fù)選框的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  在我的應(yīng)用程序中,我在某些特定操作上打印了一些文檔以及一些復(fù)選框(默認(rèn)情況下,當(dāng)頁(yè)面加載時(shí),某些復(fù)選框會(huì)被選中).

                  In my application I am printing some document along with some checkboxes (Some checkboxes get checked by default when page loads) on some specific action.

                  現(xiàn)在用戶將選中一些復(fù)選框或取消選中一些.并點(diǎn)擊更新按鈕.

                  Now user will Check some checkboxes Or may uncheck some. And clicks on update button.

                  現(xiàn)在我的要求是我想要未選中的復(fù)選框值.

                  例如:

                  當(dāng)頁(yè)面第一次加載時(shí),有 5 個(gè)復(fù)選框被選中大約 700 個(gè)復(fù)選框中的默認(rèn)值;

                  When the page loads first time there are 5 checkboxes checked by default out of some 700 check boxes;

                  現(xiàn)在用戶將取消選中 2 個(gè)復(fù)選框并單擊提交.

                  now user will uncheck 2 checkboxes and clicks on submit.

                  我的要求在這里 我想要那 2 個(gè)我的操作類中未選中的復(fù)選框值.

                  My requirement is here I want those 2 unchecked checkboxes values in my action class.

                  我正在使用 Struts2 打印這些文檔.我正在使用 Struts2-jQgrid,我嘗試使用 Struts2 CheckboxInterceptor 來(lái)獲取未選中的復(fù)選框,但它給了我所有未選中的復(fù)選框,而不僅僅是所需的復(fù)選框(改變狀態(tài)的復(fù)選框).p>

                  I am using Struts2 to print those documents. I'm using Struts2-jQgrid, I have tried Struts2 CheckboxInterceptor to get the unchecked ones but it's giving me all the unchecked checkboxes, not only the desired ones (the ones that changed their state).

                  推薦答案

                  假設(shè)您從迭代自定義對(duì)象列表開(kāi)始,

                  Assuming you start by iterating a List of custom objects,

                  private List<MyCustomObject> myList;
                  

                  并且您的自定義對(duì)象具有例如.boolean isChecked()String getValue() 方法,

                  and that your custom object has eg. boolean isChecked() and String getValue() methods,

                  您可以在目標(biāo)操作中使用兩個(gè)不同的列表:一個(gè)用于未選中但現(xiàn)在已選中的項(xiàng)目,另一個(gè)用于已選中但現(xiàn)在未選中的項(xiàng)目強(qiáng)>:

                  you could use two different Lists in the destination Action: one for the items that were unchecked and now are checked, and another one for items that were checked and now are unchecked:

                  private List<String> itemsThatHaveBeenChecked;
                  private List<String> itemsThatHaveBeenUnchecked;
                  

                  然后在頁(yè)面中,您應(yīng)該使用經(jīng)典復(fù)選框來(lái)獲取選中項(xiàng),并使用隱藏輸入來(lái)存儲(chǔ)未選中項(xiàng)的值,使用 javascript 激活其值,與復(fù)選框值相反(必須沒(méi)有名稱):

                  then in the page you should use a classic checkbox to get the checked items, and an hidden input to store the value of the unchecked items, activating its value with javascript as opposite to the checkbox value (that must have no name):

                  <s:iterator value="myList" status="ctr">
                      <s:if test="!isChecked()">
                          <!-- I'm not checked, need to catch only if I will be checked -->
                          <s:checkbox id = "checkbox_%{#ctr.index}" 
                              fieldValue = "%{getValue()}"
                                   value = "false" 
                                    name = "itemsThatHaveBeenChecked" />
                      </s:if>
                      <s:else>
                          <!-- I'm checked, need to catch only if I will be unchecked -->
                          <input type = "checkbox" 
                                   id = "<s:property value="%{'checkbox_'+#ctr.index}"/>"
                              checked = "checked"
                                class = "startedChecked" />
                          <!-- hidden trick -->
                          <input type = "hidden" 
                                   id = "hidden_<s:property value="%{'checkbox_'+#ctr.index}"/>" 
                                value = "<s:property value="%{getValue()}"/>"         
                                 name = "itemsThatHaveBeenUnchecked" 
                             disabled = "disabled" />            
                      </s:else> 
                  </s:iterator>
                  
                  <script>
                      /* Enable the hidden field when checkbox is unchecked, 
                        Disable the hidden field when checkbox is checked    */
                      $(function() {
                          $("input[type='checkbox'].startedChecked").change(function () {
                              $("#hidden_"+this.id).prop({disabled : this.checked});
                          });
                      });
                  </script>
                  

                  這樣您將只獲得兩個(gè)列表中所需的值.

                  This way you will get only the values needed in both Lists.

                  這篇關(guān)于如何在 Struts2 中獲取特定的未選中復(fù)選框的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會(huì)等待 ajax 調(diào)用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無(wú)法加載,請(qǐng)求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭) - IT屋-程序員軟件開(kāi)發(fā)技術(shù)分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請(qǐng)求是否有可能不遵循重定向 (301 302))
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)
                    <tbody id='bqHv3'></tbody>

                    • <legend id='bqHv3'><style id='bqHv3'><dir id='bqHv3'><q id='bqHv3'></q></dir></style></legend>

                      1. <small id='bqHv3'></small><noframes id='bqHv3'>

                        <i id='bqHv3'><tr id='bqHv3'><dt id='bqHv3'><q id='bqHv3'><span id='bqHv3'><b id='bqHv3'><form id='bqHv3'><ins id='bqHv3'></ins><ul id='bqHv3'></ul><sub id='bqHv3'></sub></form><legend id='bqHv3'></legend><bdo id='bqHv3'><pre id='bqHv3'><center id='bqHv3'></center></pre></bdo></b><th id='bqHv3'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='bqHv3'><tfoot id='bqHv3'></tfoot><dl id='bqHv3'><fieldset id='bqHv3'></fieldset></dl></div>

                          <tfoot id='bqHv3'></tfoot>
                            <bdo id='bqHv3'></bdo><ul id='bqHv3'></ul>

                          • 主站蜘蛛池模板: 久久久久久久久久久久久久av | 国产亚洲精品美女久久久久久久久久 | 中文字幕亚洲免费 | 我想看一级黄色毛片 | 国产一区二区三区在线免费观看 | 亚洲综合色视频在线观看 | 亚洲午夜精品一区二区三区 | 天堂色综合 | 国产精品激情 | 中文字幕影院 | 国产成人精品一区二区三区四区 | 成人h视频在线 | 中文字幕一区二区三区乱码图片 | 久久综合一区 | 国产99小视频 | 国产精品3区 | 中文视频在线 | 91视频中文 | 人成久久 | 欧美日韩中文字幕 | 天天干夜夜操视频 | 日韩中文字幕 | 国产精品免费av | 久久久久久久久中文字幕 | 国产激情一区二区三区 | 亚洲一区二区黄 | 欧美v在线观看 | 日韩一区欧美一区 | 天堂国产 | 99re视频在线 | 午夜精品一区二区三区三上悠亚 | 亚洲精品一区中文字幕乱码 | 一区二区三区回区在观看免费视频 | 欧美午夜视频 | 日日操av | 国产精品一区二区久久久久 | 一区二区三区免费 | 午夜久久久 | 一级在线免费观看 | 国产精品久久久久久久久久免费 | 亚洲人成网站777色婷婷 |