Thanks - good approach. Jeremy Burns [email protected] (Skype) +44 208 123 3822 (jeremy_burns) (m) +44 7973 481949 (h) +44 208 530 7573
On 13 Nov 2009, at 15:44, Marcelo Andrade wrote: > On Fri, Nov 13, 2009 at 4:14 AM, jburns <[email protected]> wrote: >> I am not happy with the javascript delete confirm method, as it >> doesn't appear if javascript is disabled and the delete happens with >> no checking. I want to ask the user to confirm that he wants to delete >> a record, and would like to do something like this: >> >> 1. User clicks a delete link, which points at the delete action. >> 2. The delete action redirects the user to the view screen for the >> record with a flash message asking him to confirm the delete, and >> links to confirm or reject the deletion. >> 3. If the user clicks the confirm link they are redirected back to the >> delete action but this time with a parameter that shows the action has >> been confirmed, and the deletion takes place. >> 4. The parameter identified in (3) is not present in stage (2), which >> is how (2) knows to direct to the view screen and ask for >> confirmation, rather than just processing the delete. >> 5. I am reusing the view screen and action in (2) so that I don't have >> to build new confirm_delete screens and actions (I would need to build >> about 60 of them). > > It's not so hard to do it with ordinary $html->link. > Point the delete link to a question action that do what > you want (a link to the real delete action and another > to go back). > > If you can realize how to do it this way, so you could > encapsulate the all stuff creating your own helper, > overriding the $html->link method. > > Best regards. > > -- > MARCELO DE F. ANDRADE > Belem, PA, Amazonia, Brazil > Linux User #221105 > > -- > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/cake-php?hl=. > > -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/cake-php?hl=.
