Hello All,
I recently started using the DisplayTag library and I've run into a problem.
I'm trying to create a column that will allow the user to link to another page if that other page will actually have something to display. I have it setup so that there's always a hyperlink there but I'm having trouble with the conditional. I have a variable setup that will either be empty or something else (usually success). This is what I have tried so far...
<display:table uid="log" pagesize="20" defaultsort="2" name="logs" class="displayTag" sort="list" requestURI="savedReports.action" >
<display:column property="reportName" titleKey="label.report" <%if(!((ReportLog)pageContext.getAttribute("log")).getStatus().equals("empty")){ %>href="pdfReportViewer.action" paramId="reportLogId" paramProperty="id" <%} %> sortable="true" headerClass="sortable"></display:column>
This method tries to use jsp in the middle of the display:column tag, and I end up getting an unterminated display:column tag error.
Next I tried this...
<display:table uid="log" pagesize="20" defaultsort="2" name="logs" class="displayTag" sort="list" requestURI="savedReports.action" >
<%if(((ReportLog)pageContext.getAttribute("log")).getStatus().equals("empty")){ %>
<display:column property="reportName" titleKey="label.report" sortable="true" headerClass="sortable"/>
<%}else{ %>
<display:column property="reportName" titleKey="label.report" href="pdfReportViewer.action" paramId="reportLogId" paramProperty="id" sortable="true" headerClass="sortable"/>
<%}%>
This didn't throw any errors, but every line defaulted to the hyperlink column. I tested to see if this was an error in my conditional, but alas it was not, creating a dummy column and displaying the result of the conditional, and I get a lovely assortment of trues and falses.
I'm at a loss as to why the second method doesn't work so I'm hoping someone here has some better experience with displaytags!
Thanks!