bbvic
asked on
diplay data and page number
I am trying to get data from db and would like to display the bottom.
each row contains 4 products ( 4 cols) and if the row count is 4, then add one from the previous id...
if the row id is equal to 3 then...make another page number which is added one from the provious.
would you please help....
<page id="1">
<row id="1" cols="4">
<product product_id="1" />
<product product_id="2" />
<product product_id="3" />
<product product_id="5" />
</row>
<row id="2" cols="4">
<product product_id="7" />
<product product_id="8" />
<product product_id="9" />
<product product_id="10" />
</row>
<row id="3" cols="4">
<product product_id="11" />
<product product_id="12" />
<product product_id="13" />
<product product_id="15" />
</row>
</page>
<page id="2">
<row id="4" cols="4">
<product product_id="" />
<product product_id="" />
<product product_id="" />
<product product_id="" />
</row>
<row id="5" cols="4">
<product product_id="" />
<product product_id="" />
<product product_id="" />
<product product_id="" />
</row>
<row id="6" cols="4">
<product product_id="" />
<product product_id="" />
<product product_id="" />
<product product_id="" />
</row>
</page>
....
....
...
each row contains 4 products ( 4 cols) and if the row count is 4, then add one from the previous id...
if the row id is equal to 3 then...make another page number which is added one from the provious.
would you please help....
<page id="1">
<row id="1" cols="4">
<product product_id="1" />
<product product_id="2" />
<product product_id="3" />
<product product_id="5" />
</row>
<row id="2" cols="4">
<product product_id="7" />
<product product_id="8" />
<product product_id="9" />
<product product_id="10" />
</row>
<row id="3" cols="4">
<product product_id="11" />
<product product_id="12" />
<product product_id="13" />
<product product_id="15" />
</row>
</page>
<page id="2">
<row id="4" cols="4">
<product product_id="" />
<product product_id="" />
<product product_id="" />
<product product_id="" />
</row>
<row id="5" cols="4">
<product product_id="" />
<product product_id="" />
<product product_id="" />
<product product_id="" />
</row>
<row id="6" cols="4">
<product product_id="" />
<product product_id="" />
<product product_id="" />
<product product_id="" />
</row>
</page>
....
....
...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
using java, diplays like the above xml format...
caan you provide more detail code?
caan you provide more detail code?
Available from the link CEHJ posted:
http://jsptags.com/tags/navigation/pager/pager-taglib-2.0.html#examples
http://jsptags.com/tags/navigation/pager/pager-taglib-2.0.html#examples
ASKER
using java code, the below structure diplays like the above format
<page id="value1">
<row id="value2" cols="value3">
<product product_id="value4" />
<product product_id="value5" />
<product product_id="value6" />
<product product_id="value7" />
</row>
</page>
How can i create java code?
<page id="value1">
<row id="value2" cols="value3">
<product product_id="value4" />
<product product_id="value5" />
<product product_id="value6" />
<product product_id="value7" />
</row>
</page>
How can i create java code?
:-)
You can create new pages based on multiples of 3:
if ( currentRowNnum % 3 == 0 )
{
pageNumber ++ ;
showNewPage () ;
}