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 > CellEditor/Renderer Post New Topic   Post A Reply
Date picker puzzle printer friendly version
next newest post | next oldest post
Author Messages
jms2quicktable
Private

Gender: Unspecified
Location:
Registered: Feb 2009
Status: Offline
Posts: 2

Click here to see the profile for jms2quicktable Send email to jms2quicktable Send private message to jms2quicktable Find more posts by jms2quicktable Edit or delete this message Reply w/Quote
Posted Thursday, February 5, 2009 @ 09:28:53  

Hello,

I would like to avoid displaying the date picker (for a read-only column). This does *not* show the picker:

dbTable.setSelectSql("select PNAME, DATE_TIME from PATIENT"); // query 1
dbTable.refresh();
Column col = dbTable.getColumn(0);
col.setReadOnly(true);
col = dbTable.getColumn(1);
col.setReadOnly(true);

However, if I use instead
dbTable.setSelectSql("select DATE_TIME, PNAME from PATIENT"); // query 2
the date picker is shown! I could use query 1 and do moveColumn(0, 1) to get the desired column order without showing the data picker. Anyway, this looks like a bug or feature that should not be there.

Best regards,

- Jori

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, February 5, 2009 @ 21:29:23  

I just tried to run this sql ("select DATE_TIME, PNAME from PATIENT"); and set the first column readonly and it did not show the date picker. So it might be a combination of some other issue.

can you enable debug and send me the debug log? Also if possible send the actual code to support at quicktable.org

Admin

jms2quicktable
Private

Gender: Unspecified
Location:
Registered: Feb 2009
Status: Offline
Posts: 2

Click here to see the profile for jms2quicktable Send email to jms2quicktable Send private message to jms2quicktable Find more posts by jms2quicktable Edit or delete this message Reply w/Quote
Posted Friday, February 6, 2009 @ 04:18:55  

Thanks for the quick reply. Yes, the problem here is obviously that after refresh() ReadOnly status is false. It is set to true after the date picker is shown. How can I avoid showing the picker? I would need to define the column read-only before refresh(). This *does not* work, as read-only status is lost at refresh:

Column col = dbTable.getColumn(0);
col.setReadOnly(true);
dbTable.useOldColumnProperties(true);

dbTable.setSelectSql("select DATE_TIME, PNAME from PATIENT");
dbTable.refresh();

- Jori

[Edit by jms2quicktable on Friday, February 6, 2009 @ 04:19:52]

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 Friday, February 6, 2009 @ 06:43:40  

if the table is initialized(refreshed) with another similar columns sql and if you have setreadonly(true) before, then dbTable.useOldColumnProperties(true); should work.

Or if you need to define the column read-only before refresh()., you can do
dbTable.setSelectSql(..);
dbTable.createColumnModelFromQuery() ;
dbTable.getColumn(0).setReadOnly(true);
...
dbTable.refresh()

Other ways to set readonly are
1) Using cell properties model

Code:

CellPropertiesModel simpleCellModel = new CellPropertiesModel()
{

public int getCellEditable(int row, int col)
{

if( col == 0 || col==1)
{
//readonly
return 0;
}
else
{
//editable
return 1;
}
}

};
yourQuicktable.setCellPropertiesModel(new simpleCellModel());

2) if you want all columns to be readonly
dbTable.setEditable(false);

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