tgs wrote:Ok, I will try that out. An other thing is to handle saved existing records. Edited records should set back (rollback) to the previous values with 'cancel' when perhaps inserted wrong values. Editing records in my opinion have to be saved by confirming the action and not on entering data, or?
This behaviour is what you often see with web forms, as a side-effect of the limitations of HTTP. You can get around it with Ajax.
In Servoy, I use field validation and the on_save table event to reject bad data, so I don't have any distinct 'edit' mode with a possibility to cancel. Keep it simple.
Now, you you want to go down a more complex route, you could deal with edit the following way:
- Assume each user only logged on once and editing one record in the table at any time.
- Each user has an id.
- Table filter only shows records with positive id.
- Create a record for each user with id = -userid.
These records will normally not show.
When user wants to edit, you copy the record you want to edit to the 'user specific record' and show using your 'edit' form. On save you copy back, on 'cancel' you don't. You just need to find a way not to lose the original pk of the record...