In order to use the ListControl-tag on a JSP page, the corresponding tag library must be
declared at the start of the page. Then, the Common-Controls can be used with the prefix
<ctrl:tagname />. [In addition, the tag libraries must be
included in the Deployment descriptor, the WEB-INF/web.xml file]
<%@ taglib uri="/WEB-INF/tlds/cc-controls.tld" prefix="ctrl" %>
<ctrl:list
id="userlist1"
action="sample101/userBrowse"
name="users"
title="User List"
width="500"
rows="15"
refreshButton="true"
createButton="true">
<ctrl:columndrilldown
title="Id"
property="userId"
width="65"/>
<ctrl:columntext
title="Name"
property="name"
width="350"/>
<ctrl:columntext
title="Role"
property="role.value"
width="150"/>
<ctrl:columnedit
title="Edit"/>
<ctrl:columndelete
title="Delete"/>
</ctrl:list>
All the necessary steps for using the ListControl are thus complete.
- The scrolling mechanism does not have to be self-implemented, since it is already made available by the ListControl.
- In the JSP-Page, we have determined that the ListControl should draw a maximum of 15 lines or rows. When more lines are available, the buttons for scrolling forward and back are displayed automatically.
- A click on the forward button results in a Server roundtrip and the display of the next page. The refreshing is then taken care of by the presentation framework. No additional code has to be implemented.
back |
continue
|