struts1標籤-<html:radio> 使用注意事項

來源:互聯網
上載者:User

標籤:

struts1標籤-<html:radio> 使用注意事項1、預設選中效果

  在後台XxxForm中寫入如下代碼,可保證預設選中效果實現:

@Overridepublic void reset(ActionMapping mapping, HttpServletRequest request) {ve.setBuytaxisf("是");//是否免稅交納屬性預設選中效果super.reset(mapping, request);}

  jsp代碼:

<html:radio property="ve.buytaxisf" value="是">是</html:radio><html:radio property="ve.buytaxisf" value="否">否</html:radio>

 

  頁面效果:

  好處:1、不用設定預設值;2、頁面選中效果自動實現

2、禁用效果
<html:radio property="ve.buytaxisf" value="" style="display: none"></html:radio><html:radio property="ve.buytaxisf" value="是" disabled="true">是</html:radio><html:radio property="ve.buytaxisf" value="否" disabled="true">否</html:radio>

 

  頁面效果:

  註:測試發現,當把所有radio都設定成disabled,總會把第一個預設為可選,所以可以採用如上方法實現禁用效果

struts1標籤-<html:radio> 使用注意事項

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.