0

我正在使用<display:column>,我想要一个列 ie:"id" 来显示并可以链接。到目前为止一切都很好,但我想根据条件显示链接动态。

<c:choose>
    <c:when test="${courseList.partner.area.country.id == user_country }">
            <display:column property="id" escapeXml="false" sortable="true"
                 url="/editCourse.html}" paramId="id" paramProperty="id"
                 titleKey="course.id"/>
    </c:when>
    <c:otherwise>
            <display:column property="id" escapeXml="false" sortable="true" sortName="id"/>
    </c:otherwise>
 </c:choose>

输出应该是显示的 id 列表,这些 id 不可链接,其他可链接。问题是如果第一行以可链接 id 开头,那么即使它们不符合条件,其余行也显示为可链接的,反之亦然。

你能告诉我我该如何解决吗?

提前致谢

4

1 回答 1

0

Assuming you are using Displaytag, have a look at the decorators

Possibly you can use any of the already existing decorators i e AutolinkColumnDecorator http://www.displaytag.org/1.2/displaytag/apidocs/index.html

or you might have too right your own implementation, which is fairly easy, look at http://www.displaytag.org/1.2/tut_decorators.html

于 2011-02-22T09:37:03.743 回答