Solved

diplay data and page number

Posted on 2007-03-22
6
146 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java string replace 11 53
maven module vs maven project 3 46
JavaFX TableView not displaying correctly 3 54
Java Eclipse Loop 3 20
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

792 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