----- Original Message -----
Sent: Wednesday, July 12, 2006 11:01
AM
Subject: RE: [ULC-developer]
stopCellEditing
Well i can tell you one case where i need
stopCellEditing() (or another solution).
If the user is currently editing a cell and then
presses the shortcut (e.g. "F2") in order to save the changes, the changes he
made to the currently editing cell are not written to the
model.
I found out that you can change some of these
settings over the delivery mode:
ULCTableModelAdapter.getInstance(table.getModel()).setEventDeliveryMode(UlcEventCategories.MODEL_UPDATE_CATEGORY,
UlcEventConstants.SYNCHRONOUS_MODE);
Is there any
setting i can change to force the editor to write the current editing value to
the server?
Otherwise i have
to live with your solution. But the problem is the additional client/server
roundtrip i produce.
Greets
Daniel
Hi Daniel,
AFAIK something like that cannot be achieved
because of how ULC works. The method calls that are send from the server to
the client are collected and returned to the client as a response to the
request that started your server code - some event in most cases. So even if
you write an extension to ULCTable that provides this stopCellEditing method,
there is no way to make it synchronous.
You'll have to do something like that
instead:
addCellEditingStoppedListener(new
CellEditingStoppedListner()
{
public void
cellEditingStopped()
{
saveTableData();
}
});
stopCellEditing();
You need to create this new listener type and
create obligatory bunch of listner related operations (see the ULC Extension
guide).
stopCellEditing on the client has to trigger the
event once it called the stopCellEditiing() method on the table.
You should check whether you really need it,
though. ULCTable is smarter than the Swing JTable. In some situation where you
would need to explicitely stop cell editing with a Swing JTable, ULC stops it
by itself - e.g. clicking on a button..
Cheers,
Robert
----- Original Message -----
Sent: Tuesday, July 11, 2006 9:35
AM
Subject: [ULC-developer]
stopCellEditing
Hi
I need a method
like stopCellEditing() on my table which forces the table to stop cell
editing and call the validation on current editing cell.
The problem is,
if i enhance my table which such a call (which would call the client and
there call the stopCellEditing() on jtable) the call would be
asynchronous.
But i need a
synchronous stopCellEditing() for code like this:
public void
saveTable(){
stopCellEditing();
saveTableData();
}
Can you give me
a hint how to achieve this?
Thanks in
advance
Daniel