zoukankan      html  css  js  c++  java
  • struts1标签-<html:radio> 使用注意事项

    struts1标签-<html:radio> 使用注意事项

    1、默认选中效果

      在后台XxxForm中写入如下代码,可保证默认选中效果实现:

    @Override
    public 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、页面选中效果自动实现。

      缺点:在action中接收并使用(XxxForm)xxxForm进行查询时,需将设置默认值的属性set为null,否则在查询条件(xxxForm对象)中包含默认值

    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,总会把第一个默认为可选,所以可以采用如上方法实现禁用效果

  • 相关阅读:
    linux常用命令
    chattr无法删除某个文件
    centos如何卸载软件
    linux命令行下的ftp 多文件下载和目录下载
    yum -y upgrade 和 yum -y update 区别
    Pureftpd
    centos rar安装
    linux系统数据盘挂载教程
    anyexec
    _variant_t
  • 原文地址:https://www.cnblogs.com/ylhssn/p/4180634.html
Copyright © 2011-2022 走看看