5 Replies Latest reply on Feb 2, 2009 4:49 AM by ilya_shaikovsky

    Paginating the suggestionbox

    traviskds

      Hi,

      I have been trying to create a pagination on the suggestionbox. Following is my code. What happens is that when I click on the next/previous link, the record highlighter bar goes to the next record but does not activate the autoCompleteEmail method.

      Any ideas? Following is my code.

      <rich:suggestionbox height="300" width="700" usingSuggestObjects="false"
      suggestionAction="#{employeeList.autoCompleteEmail}" var="_employee"
      for="emailAddress" fetchValue="#{_employee.emailAddress}"
      minChars="100" rowClasses="suggest-table-cell" id="suggestion">
      <f:facet name="header">
      <rich:columnGroup>
      <rich:column style="border-right:0px;">
      <h:outputText value="Suggestion Box" />
      </rich:column>
      <rich:column colspan="2" style="text-align:right;">
      <h:graphicImage value="/img/first.jpg"
      onclick="#{rich:component('suggestion')}.callSuggestion(true)"
      rendered="#{employeeList.previousExists}" style="cursor:pointer;"
      alt="First Page">
      <f:param name="firstResult" value="0" />
      </h:graphicImage>
      <h:graphicImage value="/img/prev.jpg"
      onclick="#{rich:component('suggestion')}.callSuggestion(true)"
      rendered="#{employeeList.previousExists}" style="cursor:pointer;"
      alt="Previous Page">
      <f:param name="firstResult"
      value="#{sslCertificateList.previousFirstResult}" />
      </h:graphicImage>
      <h:graphicImage value="/img/next.jpg"
      onclick="#{rich:component('suggestion')}.callSuggestion(true)"
      rendered="#{employeeList.nextExists}" style="cursor:pointer;"
      alt="Next Page">
      <f:param name="firstResult"
      value="#{sslCertificateList.nextFirstResult}" />
      </h:graphicImage>
      <h:graphicImage value="/img/last.jpg"
      onclick="#{rich:component('suggestion')}.callSuggestion(true)"
      rendered="#{employeeList.nextExists}" style="cursor:pointer;"
      alt="Last Page">
      <f:param name="firstResult" value="#{employeeList.lastFirstResult}" />
      </h:graphicImage>
      </rich:column>
      <rich:column breakBefore="true" styleClass="rich-table-subheadercell">
      <h:outputText value="Name" />
      </rich:column>
      <rich:column styleClass="rich-table-subheadercell">
      <h:outputText value="Email" />
      </rich:column>
      <rich:column styleClass="rich-table-subheadercell">
      <h:outputText value="Position" />
      </rich:column>
      </rich:columnGroup>
      </f:facet>
      <h:column>
      <h:outputText value="#{_employee.employeeName}" />
      </h:column>
      <h:column>
      <h:outputText value="#{_employee.emailAddress}" />
      </h:column>
      <h:column>
      <h:outputText value="#{_employee.position}" />
      </h:column>
      </rich:suggestionbox>