i aggre with using ajax to checking the edited record.

and display notification if the current data is edited by some other users.
and when saved, the change is displayed both, so user can choose to use
which version that the document updated.. or merge it altogether

On Tue, Mar 15, 2011 at 11:55 AM, Ryan Schmidt
<google-2...@ryandesign.com>wrote:

> On Mar 14, 2011, at 14:38, cricket wrote:
> > On Mon, Mar 14, 2011 at 11:29 AM, Sarpidon wrote:
> >>
> >
> >> What I did was to create a hidden input with the current timestamp
> >> (when the edit page is generated)
> >>
> >> Upon save I check if the record has a greater timestamp than the one
> >> from the hidden input and if so i redirect back with a flash message
> >> saying "This post has already been updated by user XXX 3 minutes ago".
>
> That sounds ok. Or you could store with each record a randomly-generated
> "edit id" when the record is saved. You'd put this edit id into the form,
> and if the edit id sent from the form doesn't match what's in the database,
> the record has been edited by someone else in the meantime. Not sure how or
> if this is better than using the timestamp as you suggest, but it is the
> strategy that FileMaker Pro employs, or at least used to employ in the early
> 2000's when I was working with it.
>
>
> >> I think this is a better approach as it does not lock the page rather
> >> than check whether the record has been updated while you were editing
> >> the page. The problem with this is that all the changes are lost. So I
> >> am thinking of creating custom validation function that will handle
> >> the data.
> >
> > I think this would frustrate me to no end as an end user. I'd much
> > rather find the file locked for editing than to discover that my
> > changes have been discarded because someone else happened to hit save
> > while I was still writing.
>
> It is the strategy employed by systems like Trac, and it seems to work ok.
> Yes sometimes I'm frustrated that someone else has edited the record. In
> these cases, I have to copy out my modifications (usually just a new
> comment), reload the page, paste, save.
>
> The problem with "locking" the record is that there isn't any such
> operation on the web. I could easily start editing a page, then decide not
> to, and close the window, or navigate somewhere else. If you use a 15-minute
> timer as suggested earlier in this thread, then you still have the original
> problem of overwriting someone else's edits if your edits take longer than
> 15 minutes to make (or if you open an edit page, forget about it, and come
> back to it more than 15 minutes later -- something I do *all* the time).
>
> An AJAX approach could work better, if thought through carefully, but is
> also more work to code, so I haven't tried to do that yet.
>
>
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to