[英]row id of jsf datatable
I want to do some opertaions in the row of my JSF datatable, and for that i need and id of row.我想在我的 JSF 数据表的行中做一些操作,为此我需要行的 ID。 But when i see html generated through firebug.
但是当我看到通过萤火虫生成的 html 时。 I notice that id is getting generated only for JSF components not of tr and td.
我注意到 id 仅针对 JSF 组件而不是 tr 和 td 生成。 Is there someway by which i can define the id of row(tr) Here is my code
有什么办法可以定义 row(tr) 的 id 这是我的代码
<h:datatable value = "#{bean.list}" var = "row">
<h:column>
#{row.name}
</h:column>
<h:column>
#{row.address}
</h:column>
<h:column>
#{row.phone no}
</h:column>
<h:column>
<h:selectBooleanCheckbox id="checkbox" value="#{row.sportsStudent}" />
</h:column>
</h:datatable>
There is a button below my datatable which says "Show only sports student" and my list should show only sports student and caption will change to "Show all students".我的数据表下方有一个按钮,上面写着“只显示体育学生”,我的列表应该只显示体育学生,标题将更改为“显示所有学生”。 now all students should be displayed.
现在应该显示所有学生。 So i was thinking if i have id of tr.
所以我在想我是否有 tr 的 ID。 I can just hide/show that row using jquery. So can i do that?
我可以使用 jquery 隐藏/显示该行。我可以这样做吗?
Thanks in advance.提前致谢。
Tarun Madaan塔伦马达安
You have several options.您有多种选择。 I can propose 2 of them:
我可以提出其中的两个:
sport
and ordinary
for others.sport
,对于其他人来说是ordinary
的。 And then you can hide/show all rows, which contains elements with ordinary
class.ordinary
class 的元素。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.