• Post Reply Bookmark Topic Watch Topic
  • New Topic

dataTable problem

 
Sushma Sharma
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to get the data from a list and show it on the front end. I am iterating through this list using datatable and subsequent elements using h:column. But my requirement is that 2 out of 3 columns should be collapsable, that means if I double click on any of the 2 column, the data/components in these 2 columns should not be shown and the height of the column should be shrunk. So, I tried to use < div > tag inside h:column tags for this purpose thinking that by making its display to "none" the data will be hidden. but that is not working because jsf is creating those divs out of the table that it generates for the dataTable.

I am not able to include the code here because I get an error message saying that there is an invalid HTML tag here and I don't know what is the problem.


is it possible to do it using jsf and how to do it?
Thanks in advance,

Sushma
 
Brian Smith
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check into using the rendered property of the column. You can make you column labels into command links and add actions to them to toggle a boolean attribute in your backing bean. Then let the rendered property determine the value of this attribute. I am just curious as to how you will show your column again if you collapse it? Perhaps you will need to use the rendered property of the individual components in your column instead of the column as a whole. That way you could provide an expand button when the column is "collapsed"
 
Sushma Sharma
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but as per your reply that column will be collapsed all all the rows. my idea is if the user double click in a particular cell, that cell will be collapsed and only a little space should remain there, so that user can double click on the cell and open it again. and that is the reason I was trying to use div tag.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!