473,395 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

how can i get the selected rows from 1 HTML Table, to another HTML Table

i am fetching table data (2 columns)from database in my JSP Page, There, my first column is checkbox
Now as checkbox is checked, that particular row should be selected and should be dislpayed in another
table, which is on the same page.
I am using ArrayList to get selected rows but i am not able to get whole data which is selected but only one row i am getting
Moreover its giving NULLPOINTEREXCEPTION, my code id like this
please help me to find out why ArrayList is not working

Expand|Select|Wrap|Line Numbers
  1. try {     
  2.  
  3.             conn = DBConnect.getConnection();
  4.               statement = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
  5.             rs1= statement.executeQuery("SELECT VENDORNAME,VENDORCODE from vew_VENDORS WHERE  VENDORNAME LIKE '"+searchVenId+"%' ORDER BY VENDORNAME");
  6.  
  7. while(rs1.next()) 
  8.                                 {
  9.                                  %>
  10.                                 <TR><td width="50"><INPUT type="checkbox" name="venSelect" value="selectven"></TD><TD id="venName[]" width="145"/>
  11.                                 <%=rs1.getString("VENDORNAME")%></TD><TD id="venCode[]" width="145"><%=rs1.getString("VENDORCODE")%></TD></TR>
  12.                                 <%    } 
  13.     <%  a1.add(rs1.getString("VENDORNAME"));            System.out.println("ArrayList.........");
  14.  
  15.     for(int i=0;i<a1.size();i++)
  16.     {
  17.     itr1=a1.iterator();
  18.     while(itr1.hasNext())
  19.     {
  20.      s1 = (String[])itr1.next();
  21.     for(j=0;j<s1.length;j++)
  22.     {
  23.                System.out.println("s1[j]="+s1[j]);
  24.     }
  25.     }
  26.     }%>                        
  27.                <%}
  28. catch(Exception e)
  29. {
  30. e.printStackTrace(System.out);
  31. }
Dec 15 '06 #1
0 1644

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: anonieko | last post by:
This example applies to javascript, table, cells, rows > > How do you access rows and columns of a HTML table? > > > <script language="javascript"> alert('start');
3
by: juststarter | last post by:
Hello, I have an aspx file where i've put a placeholder element. On load i create dynamically a table which contains a checkbox and a radiobuttonlist in each tablerow . The radiobuttonlist...
3
by: UDBDBA | last post by:
Hi All: I have a query which is running against large table. The query: SELECT DSRC_ACCT_ID, ADDR1, ADDR2, ADDR3, CITY, STATE, POSTAL_CODE, COUNT(*) FROM ERD.ADDRESSA GROUP BY DSRC_ACCT_ID,...
1
by: Big E | last post by:
I'm using ASP.Net and SQL Server 2000. I have a dropdownlist that is populated from a table. I also have the dropdownlist looking up another table to see if the user had previously selected...
4
by: juststarter | last post by:
Hello, I have an aspx file where i've put a placeholder element. On load (page_load) i create dynamically an html table which contains a checkbox and a radiobuttonlist in each tablerow . The...
3
by: jmash | last post by:
Hello, The requirement is to display rows of data on a classic ASP page for rows in a recordset. On each row we have a link at the end to show detailed information about the selected row. A...
11
by: sanju | last post by:
Dear All, I have html table and this table contains 10 Rows and 2 column, I want every time this HTML page is called by the user to view the rows Randomly. How can I do this from JavaScript? ...
1
by: imbirek8 | last post by:
Hi, I use GridView control in asp.net. I would like to write an event on the client site. When somebody click on row, I would like to clear all selected rows in GridView and changed cliked row...
1
by: vraamu | last post by:
here in this option transfer code.after transfering data from available _services multiple box to assigned_services multiple box i am unable to get the value of the assigned_services data for ex in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.