DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Display:column's Logic In The Body Content

09.01.2011
| 2781 views |
  • submit to reddit
        // display:column allows display logic as its body content

<display:table 
		name="sessionScope.searchResult" 
		pagesize="50" 
		export="true"
		id="currentRowObject" 
		requestURI="searchList.htm?action=displayTag"
		excludedParams="*"
		keepStatus="true"
		clearStatus="${param.showSearchResults == null}"
		defaultsort="1"
		defaultorder="descending"
		>

		<display:column media="html" title="ID" sortable="true">
			<c:choose>
				<c:when test="${currentRowObject.viewableByUser}">                        
					<a href="activitySummary.htm?returnPage=watchList&activityId=${currentRowObject.activityId}">
						${currentRowObject.activityId}
					</a>
				</c:when>
				<c:otherwise>
					<c:out value="${currentRowObject.activityId}"/>
				</c:otherwise>
			</c:choose>				
		</display:column>
</display:table>