<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:c="http://java.sun.com/jstl/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:a="http://richfaces.org/a4j"
                xmlns:pd="dendrarium">

    <!-- Komponent wyswietlajacy liste numerow stron odpowiedzi, np. zdan danego dendrologa

         PARAMETRY:
         pl - obiekt PaginatedList
         beanName - sesyjny bean zawiadujacy lista
         listId - identyfikator listy przekazany beanowi po kliknieciu
         ...

         Autor: pta
    -->
        <!-- UWAGA: ohydny workaround -->
    <c:if test="#{!pl.isEmpty()}">
        <c:if test="#{beanName=='answerList'}">
            <!-- Paginacja -->
            <div style="text-align:center; background: #eee"> 
                <ui:repeat value="#{pl.getPageSeq1()}" var="i">
                    <s:link action="#{answerList.getPage()}" value="#{i+1}">
                        <f:param name="page_no" value="#{i}" />
                        <f:param name="list_id" value="#{listId}" />
                    </s:link>
                    &#160;
                </ui:repeat>
                <b> #{pl.getPageNo() + 1} </b>
                &#160;
                <ui:repeat value="#{pl.getPageSeq2()}" var="j">
                    <s:link action="#{answerList.getPage()}" value="#{j+1}">
                        <f:param name="page_no" value="#{j}" />
                        <f:param name="list_id" value="#{listId}" />
                    </s:link>
                    &#160;
                </ui:repeat>
            </div>
        </c:if>
        <c:if test="#{beanName=='collisionList'}">
            <!-- Paginacja -->
            <div style="text-align:center; background: #eee"> 
                <ui:repeat value="#{pl.getPageSeq1()}" var="i">
                    <s:link action="#{collisionList.getPage()}" value="#{i+1}">
                        <f:param name="page_no" value="#{i}" />
                        <f:param name="list_id" value="#{listId}" />
                    </s:link>
                    &#160;
                </ui:repeat>
                <b> #{pl.getPageNo() + 1} </b>
                &#160;
                <ui:repeat value="#{pl.getPageSeq2()}" var="j">
                    <s:link action="#{collisionList.getPage()}" value="#{j+1}">
                        <f:param name="page_no" value="#{j}" />
                        <f:param name="list_id" value="#{listId}" />
                    </s:link>
                    &#160;
                </ui:repeat>
            </div>
        </c:if>
        <c:if test="#{beanName=='answerSearch'}">
            <!-- Paginacja -->
            <div style="text-align:center; background: #eee">
                <ui:repeat value="#{pl.getPageSeq1()}" var="i">
                    <s:link action="#{answerSearch.getPage()}" value="#{i+1}">
                        <f:param name="page_no" value="#{i}" />
                        <f:param name="list_id" value="#{listId}" />
                    </s:link>
                    &#160;
                </ui:repeat>
                <b> #{pl.getPageNo() + 1} </b>
                &#160;
                <ui:repeat value="#{pl.getPageSeq2()}" var="j">
                    <s:link action="#{answerSearch.getPage()}" value="#{j+1}">
                        <f:param name="page_no" value="#{j}" />
                        <f:param name="list_id" value="#{listId}" />
                    </s:link>
                    &#160;
                </ui:repeat>
            </div>
        </c:if>
        <c:if test="#{beanName=='packetList'}">
            <!-- Paginacja -->
            <div style="text-align:center; background: #eee">
                <ui:repeat value="#{pl.getPageSeq1()}" var="i">
                    <s:link action="#{packetList.getPage()}" value="#{i+1}">
                        <f:param name="page_no" value="#{i}" />
                        <f:param name="list_id" value="#{listId}" />
                    </s:link>
                    &#160;
                </ui:repeat>
                <b> #{pl.getPageNo() + 1} </b>
                &#160;
                <ui:repeat value="#{pl.getPageSeq2()}" var="j">
                    <s:link action="#{packetList.getPage()}" value="#{j+1}">
                        <f:param name="page_no" value="#{j}" />
                        <f:param name="list_id" value="#{listId}" />
                    </s:link>
                    &#160;
                </ui:repeat>
            </div>
        </c:if>

    </c:if>

</ui:composition>