• Creater中选择一行的方法


    1.  在表布局中增加一单选钮列,给单选钮的属性name任意设定一个值。
    2.  选择单选钮对应列,将其selectID设为单选钮的ID;将onclick设为setTimeout('initAllRows()', 0)
    3.  拷贝如下代码到对应的Page.java中    
        

    private TableSelectPhaseListener tablePhaseListener = new TableSelectPhaseListener();
        public void setSelected(Object object) {
            RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
            if (rowKey != null) {
                tablePhaseListener.setSelected(rowKey, object);
            }
        }
        public Object getSelected(){
            RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
            return tablePhaseListener.getSelected(rowKey);
        }
        public Object getSelectedValue() {
            RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
            return (rowKey != null) ? rowKey.getRowId() : null;
        }
        public boolean getSelectedState() {
            RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
            return tablePhaseListener.isSelected(rowKey);
        }


        加入以上代码之后,会在导航栏中出现selected、selectedValue、selectedState三个选项。
    4.  选择单选钮,将其属性selected和selectedValue与导航栏中出现的selected、selectedValue对应绑定。
    5.  选择表的tableRowGroup,将其属性selected设为导航栏中出现的selectedState。

    /////////////////////////////////////////

    RowKey[] rk = this.tableRowGroup.getSelectedRowKeys();
    String v = this.personDataProvider.getValue("字段", rk[0]).toString();

    之前所写,迁移至此

    原文链接:http://user.qzone.qq.com/372806800/blog/1336195536

  • 相关阅读:
    分页参数处理逻辑的最佳实践
    浅谈软件界面设计原则
    Django 页面缓存的cache_key是如何生成的
    mvn 命令上传 jar 包到 nexus 私仓
    知 识 收 录
    JavaScript 使用Map对象
    windows bat脚本守护java进程
    ubuntu java启动shell脚本
    Linux cron定时任务启动jar程序
    ubuntu java调用海康sdk报错Unable to load library '/home/bjlthy/HCNetSDK/libPlayCtrl.so'
  • 原文地址:https://www.cnblogs.com/amwuau/p/6248359.html
Copyright © 2020-2023  润新知