find next 10 records in webspeed

kaushik

New Member
hi friends,
i want to find next 10 records using webspeed . my requirement is like this just when page get loaded it should show first 10 records ,then after pressing html button (Next) it should show next 10 records ,agin pressing it should show 10 records ,i should get the data on pressing next button again and again
until i reach the last of record .

thanks in advance
 

kaushik

New Member
ton of thanks ......

here is the code tht i tried for this ....i hv not used temp table . i m facing following problem
1.I cant find the next 10 records on pressing first time after 10 it is coming 111 like tht
when i press second time then is comes ,i guess it might it due to for each item where item-num >= z.
z is value of last item-num tht i fetch when page loaded first time .
2. also i cant able to get next to next record i mean from 1- 10 recoding on page loading on first press 10- 20 record coming but not serially .then on 3rd time pressing next 20 -30 record not coming .
3 . i want to pass value of item which is shown on table in another page , i m simply able to go in in next how to send and how to get value at tht page .

kindly help me.......... i
------------------------------------------------------------------------------------
<html>
<title>Sports data List</title>
</head>
<body>
<html>
<FORM method="post">
<H1>Customer Item Information</H1>
</hr>
<table border>
<tr bgcolor="red">
<th Id ></th>
<th>Item Name</th>
<th>Price</th>
<th>on hand</th>
<th>Allocated </th>
<th>Re-Order</th>
<th>on-order</th>
<th>cat-Page</th>
</tr>


<script language="speedscript">
def var i as int initial "1".
def var x as int no-undo.
def var z as integer .
For each item no-lock:
if i<=10 then do :
</script>


<tr>
<td align=left><a href="practice.html?"`item-num`"" >`Item-num`</td>
<td align=left>`Item-name`</td>
<td align=left>`Price`</td>
<td align=left>`on-hand`</td>
<td align=left>`Allocated`</td>
<td align=left>`Re-Order`</td>
<td align=left>`on-order`</td>
<td align=left>`cat-page`</td>


</tr>
<script language="speedscript">
i = i + 1.
if i = 10 then do:
assign x = item-num.
</script>
<input name="x" value="`x`" >

<script language="speedscript">
end.
END.
else
leave.
end.
</script>


<script language=javascript>
function test()
{
var a;
if(document.getElementById("x").value == "")
{
alert("Please enter...!");

return false;
}

}
</script>
<form name="onclick-test" method="post" onsubmit="return test()">
<!--WSS
assign z = integer(get-value("x")). ##1
i = 0.
For each item where item-num >= z no-lock: -- this is not good technicque to fetch next record .
if i<=10 then do :
-->


<tr>
<td align=left><a href="practice.html?"`item-num`"" >`Item-num`</td>
<td align=left>`Item-name`</td>
<td align=left>`Price`</td>
<td align=left>`on-hand`</td>
<td align=left>`Allocated`</td>
<td align=left>`Re-Order`</td>
<td align=left>`on-order`</td>
<td align=left>`cat-page`</td>


</tr>

<script language="speedscript">
i = i + 1.
if i = 9 then do:
assign x = item-num.
</script>
<input name="x" value="`x`" > ---- on press submit button this should get stored at ##1 to fetch next 8 record .

<script language="speedscript">
end.
END.
else
leave.
end.
</script>




<BR><BR>
<input type="submit" name=btn value="press" onsubmit=test()>


</form>
</html>


 
1. Just add field in db which contains page number for records and select it with num-page condition.
2. Use another tool to display a lot more than 10 records. For example flex renders 1000 records during 1-2 seconds. It is suitable for most tables. Use filter instead pages.
 

kaushik

New Member
Dear Maxin ,
THANKS a lot for ur suggestion .
but i m not geting tht how Just adding field in db which contains page number for records and select it with num-page condition will work . only i want to display 10 records on each time i press button .
also can u send the link of flex coz i dont know about it .

Lastly pls tell me about query string to pass value on clicking link .

with regards
Kaushik
 

kaushik

New Member
THNKS MAXIM ,
u gave u new idea to develope this program. well i too i hv coded but not too good ,can u add some functionality like find prev ,
or in another button find only last 10 records like tht. also using href i m able to send data of tht particular tabl field to next page . just i dont know how to send all the field value by only clicking on one field , like on web page if we click on item-num then on next page all the field value should show .once again thanks a lot .

<html>
<title>Sports item List</title>
<head>
<script language=javascript>

function test()
{

if(document.getElementById("loop-item").value == "")
{


return false;
}

}
</script>

</head>
<body>

<html>
<form name="onclick-test1" method="post" onsubmit="return test()">

<%
def var i as int initial "1".
def var old-item as int no-undo.
def var loop-item as int no-undo.
def var z as int no-undo.
%>
<table border>
<tr bgcolor="red">
<th>Id </th>
<th>Item Name</th>
<th>Price</th>
<th>on hand</th>
<th>Allocated </th>
<th>Re-Order</th>
<th>on-order</th>
<th>cat-Page</th>
</tr>
<%
z = integer(get-value("loop-item")).
if z = 0 then do:
find first item .
end.
else do :
find item where item-num = z .
end.
repeat i = 0 to 4 :
find next item.

%>

<tr>
<td align=left><a href="practice.html?y=`item-num`" >`Item-num`</td>
<td align=left>`Item-name`</td>
<td align=left>`Price`</td>
<td align=left>`on-hand`</td>
<td align=left>`Allocated`</td>
<td align=left>`Re-Order`</td>
<td align=left>`on-order`</td>
<td align=left>`cat-page`</td>

</tr>
<%

if i = 4 then do:
assign loop-item = item-num.
%>
<input name="loop-item" value="`loop-item`" >

<%
end.
end.
%>

<input type="submit" name=btn value="next" onsubmit=test()>
</table>

</form>
</html>
 
You can assign value on pagenum-1 to prev button and pagenum+1 to next button. Generate html with these values.
Actually it is very hard for me to work this way. It takes a tonn of time and code to write simple form.

Rich clients have objects, variables that can be used on client side to save some data and pass it back through some interface like webservice.
 

kaushik

New Member
Thank you very much ur techinique is really worthy.
another question -- wht is method post or// PROCEDURE output-headers:// and IF REQUEST_METHOD = "post" THEN
DO: some code end.// kindly explain and use of these things?
with thanks
 
Top