How to adjust the position of links [last / prev] [next / last] in the display tag of Struts 2

Here is my Struts code. I would like to know how to adjust the position of the [last/prev] [next/last] links in the tag

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@taglib uri="http://displaytag.sf.net" prefix="display" %> <html> `enter code here` <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Forbes Top 10 Richest Sports Stars 2009</title> <link href="css/displaytag.css" rel="stylesheet" type="text/css" /> </head> <body> <h2>Forbes Top 10 Richest Sports Stars 2009</h2> <display:table export="true" id="data" name="sessionScope.HomeForm.richSportsmanList" requestURI="/homeAction.do" pagesize="3"> <display:column property="place" title="Place" sortable="true" /> <display:column property="name" title="Name" sortable="true" /> <display:column property="age" title="Age" sortable="true" /> <display:column property="annualIncome" title="Income(in m/yr)" sortable="true" /> </display:table> <p>Note : List is according to Forbes List 2009</p> </body> </html> 
+3
source share
2 answers

Displaytag allows you to change its functions through the display.properties file. You can override the paging.banner.placement property, which is top by default, for <display:setProperty name="paging.banner.placement" value="bottom" /> To adjust the position of the banner (where [first / previous] [next / last] link c), you must override the property

 paging.banner.full=<div class="pagelinks" align="right"><a href={1}>First</a><a href={2}>Prev</a>{0}<a href={3}>Next</a><a href={4}>Last</a></div> 

Now you need to change the style of the div tag by changing the pagelinks class or adding the style attribute to set the position of the banner. For example position: absolute; top: 75px; left: 260px; width: 245px; background-color: azure; position: absolute; top: 75px; left: 260px; width: 245px; background-color: azure;

+1
source

Roman suggested a method that you can use in the properties file. But sometimes the solution to the properties file does not work :: Here is the solution

 <display:setProperty name="paging.banner.full" value='<span class="pagelinks"><a href="{1}" onclick="return false"></a> <a href="{2}"><span class="pagenation_LeftAro"/></a> <a href="{3}"><span class="pagenation_RightAro"/></a><a href="{4}" onclick="return false"></a></span>' /> <display:setProperty name="paging.banner.first" value='<span class="pagelinks"><a href="{1}" onclick="return false"></a> <a href="{2}" onclick="return false"></a> <a href="{3}"><span class="pagenation_RightAro"/></a><a href="{4}" onclick="return false"></a></span>' /> <display:setProperty name="paging.banner.last" value='<span class="pagelinks"><a href="{1}" onclick="return false"></a> <a href="{2}"><span class="pagenation_LeftAro"/></a> <a href="{3}" onclick="return false"></a><a href="{4}" onclick="return false"></a></span>' /> <display:setProperty name="paging.banner.some_items_found" value='<span class="pagelinks"> {2}-{3} of {0}.</span>'/> <display:setProperty name="paging.banner.all_items_found" value='<span class="pagelinks">1-{0} of {0}.</span>' /> 

This way you can use the cut out paging banner.

0
source

All Articles