DisplayTags を使用して JSP にデータ テーブルを表示しています。表の列の 1 つは「優先度」列です。優先度が 1 の場合、その横に赤いライトを表示できるようにする必要があります。これを行う簡単な方法はありますか?
<display:column headerClass="tableHead" title="Priority" property="priority" sortable="false" />
データ値が「1」のすべてのセルの横に画像を表示できるようにする必要があります。
更新:例外はありませんが、まだ画像が表示されません。
<display:column headerClass="tableHead" title="Priority" property="priority" sortable="false" ><c:if test="${dispatchresults1.priority eq 1}"><img src="images/flashinglight4.gif"/></c:if> </display:column>
これが私のテーブルの一番上です。
<display:table htmlId="dispatchtable1" id="dispatchresults1" name="packedNotDispatchedlist" pagesize="20" style="width:100%;text-align:left;font-size:10px" class="thinBorder" requestURI="" export="true" >
更新:これが最終的に私にとってうまくいったことです。
<display:column headerClass="tableHead" title="Priority" sortable="false" >
<c:choose>
<c:when test="${dispatchresults1.priority eq 1}"><img src="images/flashinglight4.gif"/>
</c:when>
<c:otherwise >${dispatchresults1.priority}
</c:otherwise>
</c:choose>
</display:column>