Article View: borland.public.jbuilder.java.language
Article #18888grid picklist bug or feature?
From: Alex Humphreys
Date: Wed, 15 Apr 1998 00:00
Date: Wed, 15 Apr 1998 00:00
54 lines
3096 bytes
3096 bytes
I'm setting up a picklist in a column of a grid. The elements of the
picklist will change based on which row the cell chosen is in. I've set
this up (see the code below) by calling a new query every time a cell in
that column is chosen. The first time I choose a cell in that column,
things work fine. After that, however, the query is rerun, populating
with new data, but the values SHOWN in the picklist drop-down are the
same as were in it previously. When I choose one of those, however, I
get an error (see below) and it populates with the appropriate value
from the NEW dataset. What's going on? Does the picklist remember the
old graphic and not repaint? Is there a way to repaint the picklist, or
have it create a new graphic?
code:**********************************************************
void gridControl1_subfocusChanged(MatrixSubfocusEvent e) {
col = gridControl1.getSubfocus().column;
if (col == 2) {
try {
picklist_qds.close();
sql_str = new String("select COLIDNO, COLSNAME from MYTABLE
where COLPROJID =\'" + my_QueryDataSet.getString("COLPROID") + "\'");
picklist_qds.setQuery(new
borland.sql.dataset.QueryDescriptor(my_database, sql_str, null, true,
false));
picklist_qds.open();
}catch (DataSetException dse){
dse.printStackTrace();
}
}
}
error:*************************************************************
borland.jbcl.dataset.DataSetException: Attempt to use a DataRow with a
DataSet that it is out of sync with.
at borland.jbcl.dataset.DataSetException.throwException(Compiled Code)
at borland.jbcl.dataset.DataSetException.$xZc(Compiled Code)
at borland.jbcl.dataset.ReadRow.$Ecd(Compiled Code)
at borland.jbcl.dataset.StorageDataSet.find(Compiled Code)
at borland.jbcl.dataset.StorageDataSet.locate(Compiled Code)
at borland.jbcl.dataset.DataSet.locate(Compiled Code)
at borland.jbcl.control.PickListItemEditor.startEdit(Compiled Code)
at borland.jbcl.view.GridCore.startEdit(Compiled Code)
at borland.jbcl.view.GridCore.processMousePressed(Compiled Code)
at borland.jbcl.view.BeanPanel.processMouseEvent(Compiled Code)
at java.awt.Component.processEvent(Compiled Code)
at java.awt.Container.processEvent(Compiled Code)
at borland.jbcl.view.BeanPanel.processEvent(Compiled Code)
at java.awt.Component.dispatchEventImpl(Compiled Code)
at java.awt.Container.dispatchEventImpl(Compiled Code)
at java.awt.Component.dispatchEvent(Compiled Code)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:63)
Technical Details
Message-ID:
<35352A16.EA804BAD@sema4.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,b6fc963ed5376561,start X-Google-Attributes: gidf74b3,public From: Alex Humphreys <ahumphreys@sema4.com> Subject: grid picklist bug or feature? Date: 1998/04/15 Message-ID: <35352A16.EA804BAD@sema4.com> X-Deja-AN: 344446960 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language