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 > Column Post New Topic   Post A Reply
setType causes Column to change type to String printer friendly version
next newest post | next oldest post
Author Messages
DaveC
Unregistered
Edit or delete this message Reply w/Quote
Posted Tuesday, May 29, 2007 @ 12:14:23  

I am putting BigDecimal into a quicktable and setting the Column type to Decimal.
newCol.setType(javasql.Types.DECIMAL);
The objects somehow become Strings and getValueAt always returns string objects.
This does not happen if the type is not set. This data is manually set and is not from a database.
The table contains BigDecimals and Integers.
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 Tuesday, May 29, 2007 @ 14:08:32  

How are you loading the data into your table?
DaveC
Unregistered
Edit or delete this message Reply w/Quote
Posted Tuesday, May 29, 2007 @ 14:50:23  

I tried refreshing a vector and inserting.
After editing a cell, it becomes a string.
After an insert, it also becomes a string.
DaveC
Unregistered
Edit or delete this message Reply w/Quote
Posted Tuesday, May 29, 2007 @ 14:57:16  

It appears that when the focus of the cell is lost is when it changes the type.
DaveC
Unregistered
Edit or delete this message Reply w/Quote
Posted Thursday, May 31, 2007 @ 08:45:51  

DBTableCellEditor's getCellEditorValue() is returning textField.getText() - a string.
It is never changed from that. So, I think any editing will cause this unles a custom cell editor is used???

I noticed that datamap for that column is null. Should the call to convertDataToStore handle this?

DaveC
Unregistered
Edit or delete this message Reply w/Quote
Posted Thursday, May 31, 2007 @ 09:13:52  

oops. setDataMap for the Column class takes care of this"

colDspacing.setDataMap(new DataMap() {
public Object convertDataToDisplay(Object object) {
return object;
}
public Object convertDataToStore(Object object) {
try {
return new BigDecimal(object.toString());
} catch(Exception e) {
return new BigDecimal("0");
}
}
});

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