Hi,

We're using DisplayTag 1.1 to draw tables containing the names of
reports. We have columns showing:

Report ID
Report Name
Report Owner
Execute
Edit
Delete
Duplicate

Each report can be executed, edited, deleted and duplicated, so in the
final four columns displayed above, there are links to initiate each
of those actions. Not all reports can have all actions performed on
them.

Occasionally, none of the reports displayed in a list has, for
example, the Executable attribute set, so none of the rows has an
entry in the execute column.

We would like to stop the whole of that column from being drawn if
none of the reports has the executable attribute set.

The initial approach (before the client asked for this change) as to do this:

<display:table requestURI="listreports.page" id="row" name="reports"
pagesize="${initParam.pSize}">
<display:column href="executeReport.page" paramId="reportID"
paramProperty="report.id">
<c:if test="${row.displayExecute}">
<c:out value="[Execute]"/>
</c:if>
</display:column>
</display:table>

But what happens is that if no row can be executed, the column is
still drawn, with nothing in it - it is just very narrow.

So we used this instead:
<display:table requestURI="listreports.page" id="row" name="reports"
pagesize="${initParam.pSize}">
<c:if test="${row.displayExecute}">
<display:column href="executeReport.page" paramId="reportID"
paramProperty="report.id">
<c:if test="${row.displayExecute}">
<c:out value="[Execute]"/>
</c:if>
</display:column>
</c:if>
</display:table>

(note the new <c:if/> block surrounding the <display:column/> tag)

This works fine when no row can be executed, but in the case of some
rows being executable and others not, in the case of the
non-executable row, the other cells have shifted to the left. We would
rather have an empty cell in the case of a row without executed privs
being drawn with rows with execute privs.

The only other solution I can think of is iterating through the
resultset before the DisplayTag stage to see if any row in the
resultset has execute privs to set a variable, and then use that
variable to decide whether to output the <display:column/> tag.

Any other ideas? Thanks in advance

Rich

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to