File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How should I handle a deleted record at GUI level

 
Anayonkar Shivalkar
Bartender
Posts: 1557
5
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Since I'm not reusing deleted record numbers, and I don't want to refresh data object cache again and again, what I'm doing is:
1) When a record is deleted, simply modify a flag
2) Never use that record number

However, at GUI level, how should I handle it?
e.g. If I removed 1st record, then when a user wants to read all records, the first record in result table is actually record number 2. So, how to map this? When user 'books' a record, he/she will simply provide new data for a record. So which approach should I follow?

1) Add a recNo field in data object. This field will be set while retrieving the record and will be referred for further operations. I'll also show this recNo in display table (though it will look a little weird if user see first record with recNo 2 - in case 1st record is deleted)

2) Since 'delete' is not a 'must' requirement, I simply won't care about this (and assume that first record is recNo 1 and so on)

I personally think that I should still go for 1st approach (since 'assumption' might be risky). Any suggestions?
 
Roel De Nijs
Sheriff
Posts: 9190
77
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added a recNo field in data object, but didn't display it in the table, because that's internal information, no added value for the user (can only confuse him).
 
Sean Keane
Ranch Hand
Posts: 582
Chrome Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel De Nijs wrote:I added a recNo field in data object, but didn't display it in the table, because that's internal information, no added value for the user (can only confuse him).


I took this approach too!
 
Oladeji Oluwasayo
Ranch Hand
Posts: 101
Java Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't include a recNo in the data object but the record numbers (from the database) is displayed in the GUI, this allows me to code the logic that gets the actual selected record using the table model's getValueOf(row, 0). I also provided a filter in the GUI to remove deleted records from the table model.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic