Thursday, April 25, 2013

Display tag library 1.2


The display tag library is an open source suite of custom tags that provide high-level web presentation patterns which will work in an MVC model. The library provides a significant amount of functionality while still being easy to use.


  • Download the display tag libraries from site . or use maven dependency

  • In jsp file import taglib 
                  <%@taglib prefix="display" uri="" %>

Note : Display tag internally use the '' file. If we really want to customize the display tag we need create the '' file or add the properties in <display:set> tag in jsp . Put the '' file in your class path . If you want to customize the css of table that generate by the <display> tag , create a css file and name the css file and create the class 'displayTable' and set the class attribute of <display> tag is 'displayTable' . 

The example of display tag as below : 

<display:table id="user" name="${users}" pagesize="2" class="displayTable "requestRI="listUsers.htm">
     <display:column property="userinfo.firstname" title="First Name" />
     <display:column property="userinfo.lastname" title="Last Name" />
     <display:column property="userName" title="Login" />
     <display:column title="Email" >
<a href="mailto:${}">${}</a>
     <c:forEach var="roles" items="${roles}" >
<display:column title="${}">
  <c:forEach var="roleOfUser" items="${user.userRoles}">
    <c:set var="roleId" value="${roleOfUser.role}"></c:set>
          <c:when test="${ eq }">
    <i class="icon-ok"></i>
     <display:column title="Edit" > 
       <a href="#" onclick="javascript:window.location.href='editUser.htm?userName=${userList.userName}';">
  <i class="icon-pencil"></i>
     <display:column title="Delete">
        <a href="deleteUser.htm?id=${userList.userName}" onclick="return confirm('Warning: This deletes the data from everywhere! Are you sure?')">
  <i class="icon-remove"></i>
     <display:setProperty name="paging.banner.placement" value="bottom" />
     <display:setProperty name="basic.msg.empty_list"  value="No Records Found" />   </display:table>

No comments:

Post a Comment