Solved

diplay data and page number

Posted on 2007-03-22
6
147 Views
Last Modified: 2010-03-31
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>
....
....
...
0
Comment
Question by:bbvic
  • 2
  • 2
  • 2
6 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 18771659
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 18772542
>> if the row id is equal to 3 then...make another page number

You can create new pages based on multiples of 3:

if ( currentRowNnum % 3 == 0 )
{
  pageNumber ++ ;
  showNewPage () ;

}
0
 

Author Comment

by:bbvic
ID: 18777465
using java, diplays like the above xml format...

caan you provide more detail code?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 30

Expert Comment

by:Mayank S
ID: 18777473
0
 

Author Comment

by:bbvic
ID: 18784361
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?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 18835178
:-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question