I have been trying to achieve this functionality of expand/collapse of table rows using core JSF and also I have to preserve the sorting. Is there a way in core JSF where I can achieve this functionality?
相关问题
- java.lang.NullPointerException at java.io.PrintWri
- h:selectOneMenu in p:dataTable doesn't submit
- h:selectOneMenu in p:dataTable doesn't submit
- PrimeFaces block UI does not work when the compone
- primefaces orderlist not getting updated with the
相关文章
- System.OutOfMemoryException:“数组维度超过了支持的范围。”
- Trigger a Bootstrap .collapse('toggle') vi
- How to allow numbers only using f:validateRegex
- Selecting all visible rows after a search using
- JSF 2.0: ajax request when press ENTER
- how to disable show entries property in jquery dat
- android - collapse searchview after submit
- Formatting a double in JSF
Simple expandable table with RichFaces
We can do Simple expandable table with RichFaces and the code is given below...
I don't think you can do this with 'core' JSF (by which I assume you mean using only the reference implementation).
As I understand it, you can accomplish subtables with RichFaces subTable
You can also do a similar thing with IceFaces - see the component showcase (it's under Table -> Expandable Table). However either of these would require you adding and setting up another library (RichFaces or IceFaces) which is probably not what you want.
If you insist in using reference implementation only, then you can't go around using a nested
h:dataTable
and/orh:panelGroup
and a good shot of CSS to get it aligned nicely. You can then use JavaScript the smart way to show/hide row details.Here's a basic kickoff example:
The
toggleDetails()
function can look like (note that it takes JSF generated client ID into account):