I'm trying to change an existing data table (written by a previous developer) so that you see the whole table if logged in as sysadmin but only see your own details if logged in as someone else.

I've tried doing this by adding a rendered tag to each value in the table. This has let me see that my checks are working and get the basic test working. That part of the code is functioning as intended. However, there's an obvious flaw in that the extra rows still get generated whether they are filled up or not.

When not systemAdministrator it (predictably) outputs something like this:

with all the rows generated but only filled in for the current user.

I understand why it's doing this, but I'm not sure how to get it to do what I want it to do instead. It's like I want to render/not render the whole row but the data table is generated by column not row so I can't see how to add that. Even adding a <c:if>, I'd need to add it around the row, so I don't see how I can do that when it's generated by column.

The other idea I had was that I could just check to see if the row is empty and if so hide it? But that feels a bit dirty to me.

Which of these options would be best and how do I get around the checking/hiding row without row tags thing? Or do I need to restructure the whole table? (Might be above my ability.)

Edit:

The showClass/hideClass rowClasses that @xild suggested looks like this:

Is providing a transient property in the backing bean an option? IMHO I'd create a userVisibleAccounts field in userBean that holds just the information the current user can access.
–
mabiFeb 4 '14 at 16:04

<h:column rendered> renders on a per-column basis (thus, applies to all rows), not on a per-row basis. First and third suggestion are however okay.
–
BalusCFeb 5 '14 at 8:53

Agree about the <h:column rendered> one. I presume the final one you are suggesting replacing the existing rowClasses? I tried it and it produced the same output but without the lines in between the rows (will edit question to include another screenshot).
–
starsplusplusFeb 5 '14 at 8:57