I have about 500 items in a database (MS SQL server 2008). These individual items have some other properties stored as tables. I am trying to display these items as html links on either a JSP/HTML page. I have a page with alphabets A....Z which are html links in themselves. When I click link "A", it should display all the items in the database that start with an A. Each row should be displayed with a checkbox, item name, text box(for qty) and a button "add to cart". In addition, the item name has to be a clickable link, which when clicked, displays the different properties as an html page using the information from the database. Can someone pls give an idea as to the steps needed to achieve this functionality.

Recommended Answers

All 4 Replies

My ideas.

1. When your user click your A-Z link, it should call a function that fetches records from your database that starts with the chosen letter.

2. Then, you need to create a table for all your records in your dataset. For each record in your resultset, you need to add a row in your created table.

3. Item name should be an href so that when user clicks on this, you will again create another page that will display the information form your database.


hope this helps (",).

My ideas.

1. When your user click your A-Z link, it should call a function that fetches records from your database that starts with the chosen letter.

2. Then, you need to create a table for all your records in your dataset. For each record in your resultset, you need to add a row in your created table.

3. Item name should be an href so that when user clicks on this, you will again create another page that will display the information form your database.


hope this helps (",).

Thanks very much. Can you explain me with some code if possible how the row is implemented. The row should have a radio button/check box, item name(which itself is an HTML link), textbox(for qty) and an "add to cart" button. This basically involves dynamically constructing a HTML page as a formatted output.

Here's a very rough code for you to start with. I used tables.

</table>

<% for (int i = 0; i < your resultSet.length(); i++) { %>

<tr>
<td> put your checkbox here</td>
<td> put item name here (should be an href)</td>
<td> put text box here</td>
<td> put "add to cart" button here</td>
</tr>

<% } %>

Here's a very rough code for you to start with. I used tables.

</table>

<% for (int i = 0; i < your resultSet.length(); i++) { %>

<tr>
<td> put your checkbox here</td>
<td> put item name here (should be an href)</td>
<td> put text box here</td>
<td> put "add to cart" button here</td>
</tr>

<% } %>

Thank you very much. I will start and try it out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.