开发者

How can i show different images in display:column based on other column's value?

开发者 https://www.devze.com 2023-03-08 10:15 出处:网络
i am using disp开发者_如何学Clay tag for showing table in my jsp page. I need to show different images in one column of table based on other column\'s value.

i am using disp开发者_如何学Clay tag for showing table in my jsp page. I need to show different images in one column of table based on other column's value.

Below is the code snippet from my jsp page:

<s:if test="appStatusList.size() != 0">

        <display:table name="appStatusList" class="its">
            <display:caption>App Status</display:caption>
            <display:column property="currentStatus" title="Current Status" />
            <display:column property="updateDate" title="Update Date" />
            <display:column > <img src="/AppUpdatePortal/images/delete.png" /></display:column>

        </display:table>

    </s:if>

How can i change image src based on other column value. Please help.

Thanks Jyoti


Read http://www.displaytag.org/1.2/tut_implicitobjects.html. If you add an id attribute to your display:table tag, you may have access to the current object of the list.

<display:table name="appStatusList" class="its" id="appStatus">
    <display:caption>App Status</display:caption>
    <display:column property="currentStatus" title="Current Status" />
    <display:column property="updateDate" title="Update Date" />
    <display:column><img src="/AppUpdatePortal/images/${appStatus.currentStatus}.png" /></display:column>
</display:table>


How about this?

      <display:column > <img src="/AppUpdatePortal/images/${YOUR_FORM.status}.png" />
</display:column>
0

精彩评论

暂无评论...
验证码 换一张
取 消