java getselectedrow_Creater中选择一行的方法

1.  在表布局中增加一单选钮列,给单选钮的属性name任意设定一个值。

2.  选择单选钮对应列,将其selectID设为单选钮的ID;将onclick设为setTimeout('initAllRows()', 0)

3.  拷贝如下代码到对应的Page.java中

private TableSelectPhaseListener tablePhaseListener = newTableSelectPhaseListener();public voidsetSelected(Object object) {

RowKey rowKey= (RowKey)getValue("#{currentRow.tableRow}");if (rowKey != null) {

tablePhaseListener.setSelected(rowKey, object);

}

}publicObject getSelected(){

RowKey rowKey= (RowKey)getValue("#{currentRow.tableRow}");returntablePhaseListener.getSelected(rowKey);

}publicObject getSelectedValue() {

RowKey rowKey= (RowKey)getValue("#{currentRow.tableRow}");return (rowKey != null) ? rowKey.getRowId() : null;

}public booleangetSelectedState() {

RowKey rowKey= (RowKey)getValue("#{currentRow.tableRow}");returntablePhaseListener.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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值