• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to force validation?

 
Rambo Rambabu
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a table in which one column is editable. When I press the save button, I need to take the values in for each cell and do some validations and send data to the database.
For the last edited cell, I am not getting the value that is there is on the screen. It is showing the value just before the most recent change.
I don't know how to trick the UI to think that I left that cell when I press the button.
-- rambo
 
Rene Liebmann
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you take the values? Do you have a TableModel behind? Can you post some simple code? Do you use your own TableCellEditor? If yes, you could work with the FocusLost event. There you can set your model. What happens if you press Return after your last input?
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is still in edit mode. Do this:
dataTable.getCellEditor().stopCellEditing();
That should do it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!