$row := $rs->getRow %>
<tr><td colspan="2" class="celltitle"><% =$previous + $pages + $next %></td></tr>
   <%  $loop:=0
           for ($loop; $batch{"start"}; $batch{"end"})
                $rs->gotoRow($loop)
                $Color:=RowColor_Get($loop)
                $id := EncodeQueryString(string([Companies]ID))
                $key := EncodeQueryString("CID")


What is EncodeQueryString doing? If it is doing url encoding, it shouldn't, 'build query string' does that for you.



                $query := build query string(""; $key; $id) %>
<tr><td bgcolor="<% =$Color %>"><a href="/companies/home.html<% = $query %>"><% =$row{"companyid"} %></a></td>
<td bgcolor="<% =$Color %>"><% =$row{"companyname"} %></td></tr>
<% end for %>


Don't see any code to display the batch stuff.




clicking either Prev or Next gives the error:

$start := max of(num($attributes{"bst"}); 1)
Expecting a numeric expression or a text expression or a boolean expression.


num() is failing to find a value it likes.



Would some explain the what and the why? Or barring that, a working, non-fusebox example of batches and rowset.


This won't win any beauty contents, but it works with the demo database:

<%
all records([ingredients])
$rs := RowSet.newFromSelection(->[ingredients]; "name:[ingredients] name;vendor:[vendors]name")
$attributes := merge collections(form variables; query params)
$start := max of(num($attributes{"bst"}); 1)
$batch := Batch.newFromRowset($rs; 10; $start)

$prev := "Previous"
$batches := "&nbsp;"
$next := "Next"
$needBatch := $batch->makeLinks($prev; $batches; $next; requested url)

$row := $rs->getRow
writeln("<table style=\"background: #ddd\">")

for ($i; $batch{"start"}; $batch{"end"})
    $rs->gotoRow($i)
write('<tr>\n<td>$row{"name"}</td>\n<td>$row{"vendor"}</td>\n</ tr>\n')
end for

writeln("</table>")
writeln("%s&nbsp;&nbsp;%s&nbsp;&nbsp;%s" % ($prev; $batches; $next))
%>

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