• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to force validation?

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is still in edit mode. Do this:
dataTable.getCellEditor().stopCellEditing();
That should do it.
 
reply
    Bookmark Topic Watch Topic
  • New Topic