craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > General QuickTable Support/Help Post New Topic   Post A Reply
InsertEmptyRecord printer friendly version
next newest post | next oldest post
Author Messages
rafalele
Unregistered
Edit or delete this message Reply w/Quote
Posted Tuesday, November 9, 2004 @ 07:20:54  

Hi again, and thanks i advance again.
I'm trying to insert an empty record to fill it after using setValueAt.
If the table has at least one record, everything works OK, but if the table is empty I get the next error from set value, trying to fill row 0 and column 0 with a valid value:
Index: -1, Size: 10
The process works OK with the rest of the columns.
Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Thursday, November 11, 2004 @ 17:24:42  

It tried the following immediately after creating a new instance of DBTable

dBTable1.insertEmptyRecord();
dBTable1.setValueAt("test",0,0);

It didn't give any error. Are you sure you are getting this error for 0,0 ?

rafalele
Unregistered
Edit or delete this message Reply w/Quote
Posted Friday, November 12, 2004 @ 02:51:59  

Hi, and thanks.

What I usually do is remove all default columns in the table (A, B, C, D), at the beginning, and add new ones creating each column with dbCol = new quick.dbtable.Column() and add it to the table as dBTable.addColumn(dbCol)

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Saturday, November 13, 2004 @ 00:11:32  

I am not sure why you are adding data to quicktable this complex way instead of other simpler ways. For example, you can create a vector of vectors or a two dimensional array of objects and then just call refreh(vector) or refresh(array). Then you can set the column properties one by one.

If you still want to follow your way, instead of using the default Column() constructor use new Column(index) constructor while creating columns and then start the index from 1 upto the maximum length (instead of 0 to length-1)

Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios