日期:2014-05-18  浏览次数:20695 次

请教关于jsf datetable 行选变色取值得问题
现在做的项目有一个要求,一个动态取出数据的表

<t:dataTable   value= "#{perMainBean.employee} "   var= "personnel "
border= "1 "   styleClass= "customers "
headerClass= "table-header "   binding= "#{perMainBean.table} "   width= "750px "
rowId= "#{personnel.employeeCode}
>

这是表的信息..   只有一个字段employeeCode   其他的字段忽略..

要求鼠标点中数据的某一行时,要求选中行的颜色发生改变   。点击按钮谈出新窗口,在新窗口可以取到该行的值employeeCode。

要求只能选中其中一行   ,不可以多行选择。

刚接触jsf   ,这个问题对我太难了,望各位大大们多帮忙

(忘了一点:不能用单选框之类的来选择...   客户要求)

------解决方案--------------------
可以把它当作一个动态表 这样用它的innerHTML 属性可以取得表元 取到后就可以处理一下就有数据了
------解决方案--------------------
变色如下解决:
<t:dataTable value= "#{perMainBean.employee} " var= "personnel "
border= "1 " styleClass= "customers "
headerClass= "table-header " binding= "#{perMainBean.table} " width= "750px "
rowOnMouseOver= "this.style.backgroundColor= '#A5CBFF ' "
rowOnMouseOut= "this.style.backgroundColor= '#FFFFE0 ' "
rowOnClick= "this.style.backgroundColor= '#FFE0E0 ' "
rowOnDblClick= "this.style.backgroundColor= '#E0E0E0 ' "

rowId= "#{personnel.employeeCode}
>
第二个问题请详细说明你要做什么,完成什么功能
------解决方案--------------------
up
------解决方案--------------------
不能用CommandButton,用下在的方法
<h:commandLink value= "提交 " action= "#{some.method} " target= "_blank ">
<f:param name= "id " value= "somevalue "/>
</h:commandLink>