Chris Mylonas
2014-04-16 13:52:01 UTC
Hi Tapsters,
I'm converting an old table with a t:Loop component into a t:Grid component.
I used to have a table that hid the username/password columns and now for a
non-admin user with the grid the columns show.
You can see the code below.
Would I have to define the <t:grid ..............> inside a
<t:security.hasRole role="ADMIN"> block to get the desired effect of
showing the extra columns for admin users?
And have the <p:else> contain the grid excluding the username/password
columns?
The second problem is in my t:Loop component, the class was happily being
displayed as the ${currentNetworkInformation.status} where inuse would be
css red and available would be css green.
However with the t:Grid component, the class =
${currentNetworkInformation.status} is telling me it is null.
I can't use cycle, because I'm not really doing a zebra effect. It's a
status based on the row value "effect" *ta boom tish*
Any help on my two things would be great. It's been a month between
tapestry development, the first 2 hours was spent re-installing my app
server and mucking around with t:parameter deprecation - not the most
useful 2 hours :P
Apart from my little grid problems, maybe I will stick with it - paging is
very very very handy on /19 subnets (thousands of ip addresses)!
Thanks
Chris
<tr t:type="Loop" t:source="assignedAddresses"
t:value="currentNetworkInformation"
class="${currentNetworkInformation.status}">
<td>${currentNetworkInformation.status}</td>
<td><a
href="ssh://${currentNetworkInformation.ipaddress}">SSH</a></td>
<td>${currentNetworkInformation.device}</td>
<td>${currentNetworkInformation.location}</td>
<t:security.hasRole role="ADMIN">
<td><t:pagelink page="admin/UpdateAddress"
context="currentNetworkInformation.id">${currentNetworkInformation.ipaddress}</t:pagelink></td>
<p:else>
<td>${currentNetworkInformation.ipaddress}</td>
</p:else>
</t:security.hasRole>
<td>${subnetMaskEnumStringService.convertNetmask(currentNetworkInformation.mask)}</td>
<td>${currentNetworkInformation.vlan}</td>
<td>${currentNetworkInformation.vrf}</td>
<td>${currentNetworkInformation.gateway}</td>
<t:security.hasRole role="ADMIN">
<td>${currentNetworkInformation.username}</td>
<td>${currentNetworkInformation.password}</td>
</t:security.hasRole>
</tr>
And I've moved to a grid.
<t:grid source="assignedAddresses" row="currentNetworkInformation"
add="login"
exclude="id,_persistence_shouldRefreshFetchGroup,subnetId,addressType,OctetsInt1,OctetsInt2,OctetsInt3,OctetsInt4"
reorder="status,login,device,location,ipaddress,mask,vlan,vrf,gateway,username,password"
rowsPerPage="256" class="${currentNetworkInformation.status}">
<p:loginCell>
<a href="ssh://${currentNetworkInformation.ipaddress}">SSH</a>
</p:loginCell>
<p:ipAddressCell>
<t:security.hasRole role="ADMIN">
<t:pagelink page="admin/UpdateAddress"
context="currentNetworkInformation.id">${currentNetworkInformation.ipaddress}</t:pagelink>
<p:else>
${currentNetworkInformation.ipaddress}
</p:else>
</t:security.hasRole>
</p:ipAddressCell>
<p:usernameCell>
<t:security.hasRole role="ADMIN">
${currentNetworkInformation.username}
</t:security.hasRole>
</p:usernameCell>
<p:passwordCell>
<t:security.hasRole role="ADMIN">
${currentNetworkInformation.password}
</t:security.hasRole>
</p:passwordCell>
</t:grid>
I'm converting an old table with a t:Loop component into a t:Grid component.
I used to have a table that hid the username/password columns and now for a
non-admin user with the grid the columns show.
You can see the code below.
Would I have to define the <t:grid ..............> inside a
<t:security.hasRole role="ADMIN"> block to get the desired effect of
showing the extra columns for admin users?
And have the <p:else> contain the grid excluding the username/password
columns?
The second problem is in my t:Loop component, the class was happily being
displayed as the ${currentNetworkInformation.status} where inuse would be
css red and available would be css green.
However with the t:Grid component, the class =
${currentNetworkInformation.status} is telling me it is null.
I can't use cycle, because I'm not really doing a zebra effect. It's a
status based on the row value "effect" *ta boom tish*
Any help on my two things would be great. It's been a month between
tapestry development, the first 2 hours was spent re-installing my app
server and mucking around with t:parameter deprecation - not the most
useful 2 hours :P
Apart from my little grid problems, maybe I will stick with it - paging is
very very very handy on /19 subnets (thousands of ip addresses)!
Thanks
Chris
<tr t:type="Loop" t:source="assignedAddresses"
t:value="currentNetworkInformation"
class="${currentNetworkInformation.status}">
<td>${currentNetworkInformation.status}</td>
<td><a
href="ssh://${currentNetworkInformation.ipaddress}">SSH</a></td>
<td>${currentNetworkInformation.device}</td>
<td>${currentNetworkInformation.location}</td>
<t:security.hasRole role="ADMIN">
<td><t:pagelink page="admin/UpdateAddress"
context="currentNetworkInformation.id">${currentNetworkInformation.ipaddress}</t:pagelink></td>
<p:else>
<td>${currentNetworkInformation.ipaddress}</td>
</p:else>
</t:security.hasRole>
<td>${subnetMaskEnumStringService.convertNetmask(currentNetworkInformation.mask)}</td>
<td>${currentNetworkInformation.vlan}</td>
<td>${currentNetworkInformation.vrf}</td>
<td>${currentNetworkInformation.gateway}</td>
<t:security.hasRole role="ADMIN">
<td>${currentNetworkInformation.username}</td>
<td>${currentNetworkInformation.password}</td>
</t:security.hasRole>
</tr>
And I've moved to a grid.
<t:grid source="assignedAddresses" row="currentNetworkInformation"
add="login"
exclude="id,_persistence_shouldRefreshFetchGroup,subnetId,addressType,OctetsInt1,OctetsInt2,OctetsInt3,OctetsInt4"
reorder="status,login,device,location,ipaddress,mask,vlan,vrf,gateway,username,password"
rowsPerPage="256" class="${currentNetworkInformation.status}">
<p:loginCell>
<a href="ssh://${currentNetworkInformation.ipaddress}">SSH</a>
</p:loginCell>
<p:ipAddressCell>
<t:security.hasRole role="ADMIN">
<t:pagelink page="admin/UpdateAddress"
context="currentNetworkInformation.id">${currentNetworkInformation.ipaddress}</t:pagelink>
<p:else>
${currentNetworkInformation.ipaddress}
</p:else>
</t:security.hasRole>
</p:ipAddressCell>
<p:usernameCell>
<t:security.hasRole role="ADMIN">
${currentNetworkInformation.username}
</t:security.hasRole>
</p:usernameCell>
<p:passwordCell>
<t:security.hasRole role="ADMIN">
${currentNetworkInformation.password}
</t:security.hasRole>
</p:passwordCell>
</t:grid>