I've successfully created a RowSet (very nice) and I have created a Batch from the RowSet (the links are there, but they don't limit the rowset).

Where in the documentation does it tell me how to use the two together? The Batch must somehow limit the RowSet to a subset, but how?

Sorry, I forgot to document how to use the batch to loop through the RowSet. Here's a typical example, assuming $qryContacts is a RowSet you already created:

<%
// Get the starting index from the query string. If it wasn't there
// the num() of it will be zero, so force it to 1.

$start := max of(num($attributes{"bst"}); 1)

// Now make the batch
$batch := Batch.NewFromRowSet($qryContacts; 10; $start; 0; 3)

// Setup the link info, make the links
$previous := "&lt;&lt; Previous|batch-previous"
$pages := "&nbsp;"
$next := "Next &gt;&gt;|batch-next"
$needPages := $batch->makeFuseboxLinks($previous; $pages; $next; $attributes; ""; ""; "b")
%>

<table>
  <tr>
    <th>Name</th>
    <th>Phone</th>
  </tr>
<%
   $row := $qryContacts->getRow
   $alt := true

   for ($i; $batch{"start"}; $batch{"end"})
      $qryContacts->gotoRow($i)
      $alt := not($alt)
%>
  <tr <%=choose($alt; "class=\"row-alt\""; "")%>>
    <td><%=$row{"name"}%></td>
    <td><%=$row{"phone"}%></td>
  </tr>
<% end for %>
</table>


Regards,

   Aparajita
   www.aparajitaworld.com

   "If you dare to fail, you are bound to succeed."
   - Sri Chinmoy   |   www.srichinmoylibrary.com


_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to