SOLVED: double confirm delete

2006-03-13 Thread Boris Herman

Hi list

perhaps another newbie like me will appreciate this tip: To have an  
action require double confirmation (WOConfirmPanel only asks once) I  
did this:
made a dblconfirm.scp file and added it into web resources. Contents  
of the script file:


function dblconfirm(prompt)
{
 if (confirm(prompt) && confirm("CONFIRM: "+prompt))
 { return true; }
 else
 { alert("Cancelled."); return false; }
}

Added a WOJavaScript to the component (binding scriptFile to  
"dblconfirm.scp"). For every hyperlink that needs double confirmation  
I added a custom binding attribute "onClick" with following binding:  
"return dblconfirm('Really delete the record?')"


It may be a really newbie problem and solution but I am certain that  
it might be handy to someone else as well as to me.


Regards,
Boris
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com


Re: double confirm delete

2006-03-05 Thread Michael Warner
Boris,  someone will answer your question directly.   I am writing to  
suggest that you propose an alternative to your client.
My suggestion may not be appropriate in your specific case,  and if  
not,  just ignore it.


There are at least 2 reasons why you might not want users (be they  
administrative users or just plain old users) to delete records from  
a database:
(1) once the data is deleted, you cannot get it back without some  
difficulty (i.e.  restoring by hand some previous backed-up version  
of the database or part of the database).
(2) if there are relationships in the database, and the delete rules  
are not set exactly right,  related data can be inadvertently deleted  
OR, in some cases, related data might
not be deleted when it should have been deleted.   This can of course  
damage the referential integrity of your database.


An alternative which I sometimes suggest to clients is that no data  
will ever be deleted from the database.  Instead, for the most  
important tables, I add a 'status' attribute.   It can take values
of Active / Inactive (1 / 0 ) or sometimes, "Active / Inactive /  
Obsolete" -- with the obsolete option being an indication by the user  
that the record is now bogus in some way, or, for example that it  
points to

a user record where the user is known to be deceased.

Then I provide a search option in which the user can search just on  
active records  or just on inactive records.


The advantage of this approach is that the user never can  
inadvertently delete information, later regret it, and have no option  
but to turn to you or the database administrator in desperation.
The user, especially the administrative user,  remains in complete  
control of her or his data.Every so often,  if it is necessary to  
keep a table from getting too large,  the super user (e.g. the  
database administrator) can purge records that have been tagged as  
obsolete, or records that have been inactive for a certain period of  
time.


Mike Warner

On Mar 5, 2006, at 3:48 PM, Boris Herman wrote:


Hello

I have a delete action of an object bound to JSConfirm which  
prompts the user to confirm the deletion. However, the client wants  
the delete action to double confirmed - i.e. "are you sure?" and  
then "are you really sure?". Does anyone have an idea on how to  
achieve that? Help would be greatly appreciated.


Regards,
Boris
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/mmwarner% 
40unr.edu


This email sent to [EMAIL PROTECTED]


___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com


double confirm delete

2006-03-05 Thread Boris Herman

Hello

I have a delete action of an object bound to JSConfirm which prompts  
the user to confirm the deletion. However, the client wants the  
delete action to double confirmed - i.e. "are you sure?" and then  
"are you really sure?". Does anyone have an idea on how to achieve  
that? Help would be greatly appreciated.


Regards,
Boris
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com