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
setValue(...) doesnt work printer friendly version
next newest post | next oldest post
Author Messages
sandeep.bhatt
Private

Gender: Unspecified
Location:
Registered: Apr 2007
Status: Offline
Posts: 9

Click here to see the profile for sandeep.bhatt Send email to sandeep.bhatt Send private message to sandeep.bhatt Find more posts by sandeep.bhatt Edit or delete this message Reply w/Quote
Posted Tuesday, April 24, 2007 @ 07:06:25  

Hi,

say i ve a single row in my QuickTable with column1 value = " ABC" and column21 value =" 200"

Now i want to update the row with column21 value to 100 from 200

here is the code am using:-

for(int i=0;i<odbtable.getRowCount();i++ ) {

String sendcompID = (String)odbtable.getValueAt(i,0);

if(sendcompID.equals("ABC")) {

Integer CumQty = new Integer(100);
odbtable.setValueAt(CumQty,i,21);
}
System.out.println(odbtable.getValueAt(i,21));
}
}

The System.println stmt prints the changed column value i.e 100
but still the table shows the old value.

how do i get the table to display the changed value.

Thanks in advance.

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 Monday, April 30, 2007 @ 01:29:42  

sometimes UI do not get refershed, in thats case try calling

dbtable.validate();
dbtable.repaint();
after calling setvalueat().

Also try to adding a system.out as below and check whether you are really setting it?

if(sendcompID.equals("ABC")) {

Integer CumQty = new Integer(100);
odbtable.setValueAt(CumQty,i,21);
System.out.println("setting value");

}

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