프로젝트 > Java Resources > Libraries > Maven Dependencies > egovframework.rte.ptl.mvc-3.9.0.jar > egovframework.rte.ptl.mvc > tags.ui > pagination
프로젝트 > Java Resources > src/main/java > com.repia.apps > common > cmmn > web - DashboardCmmnTextPaginationRenderer.java\\
public class DashboardCmmnTextPaginationRenderer extends AbstractPaginationRenderer implements ServletContextAware{ private ServletContext servletContext; public DashboardCmmnTextPaginationRenderer() { // no-op --> no-operation이란 의미인가? } public void initVariables() { firstPageLabel = "<li class=\"page-item\"><a href=\"javascript:;\" onclick=\"{0}({1}); return false;\" class=\"page-link\"><<</a>\n</li>"; previousPageLabel = "<li class=\"page-item\"><a href=\"javascript:;\" onclick=\"{0}({1}); return false;\" class=\"page-link\"><</a>\n</li>"; currentPageLabel ="<li class=\"page-item active\"><a href=\"javascript:;\" onclick=\"{0}({1}); return false;\" class=\"page-link\">{0}</a>\n</li>"; otherPageLabel = "<li class=\"page-item\"><a href=\"javascript:;\" onclick=\"{0}({1}); return false;\" class=\"page-link\">{2}</a>\n</li>"; nextPageLabel = "<li class=\"page-item\"><a href=\"javascript:;\" onclick=\"{0}({1}); return false;\" class=\"page-link\">></a>\n</li>"; lastPageLabel = "<li class=\"page-item\"><a href=\"javascript:;\" onclick=\"{0}({1}); return false;\" class=\"page-link\">>></a>\n</li>"; } @Override public void setServletContext(ServletContext servletContext) { this.servletContext = servletContext; initVariables(); } }
1)dispatcher-servlet.xml에 bean 설정
... ... <!-- For Pagination Tag --> <bean id="imageRenderer" class="com.repia.apps.common.cmmn.web.AppsCmmnImgPaginationRenderer"/> <!-- 커스텀 페이지네이션 렌더러 등록 --> <bean id="dashboardTextRenderer" class="com.repia.apps.common.cmmn.web.DashboardCmmnTextPaginationRenderer"/> <bean id="paginationManager" class="egovframework.rte.ptl.mvc.tags.ui.pagination.DefaultPaginationManager"> <property name="rendererType"> <map> <entry key="image" value-ref="imageRenderer"/> <entry key="dashboardText" value-ref="dashboardTextRenderer"/><!-- type 프로퍼티값 등록 --> </map> </property> </bean> <!-- /For Pagination Tag --> ... ...
2)“bean 설정 정보와 사용자가 태그에서 입력한 type 프로퍼티값을 기반으로 PaginationManager의 getRendererType메소드가 PaginationRenderer의 구현 클래스 객체를 반환한다.”
PaginationManager.class
public interface PaginationManager { public PaginationRenderer getRendererType(String type); }
... ... <div class="card-tools"> <div id="projMngPaging"> <ul class="pagination justify-content-end m-0"> <ui:pagination paginationInfo="${paginationInfo }" type="dashboardText" jsFunction="fn_select_linkPage" /> </ul> </div> </div> ... ...