On Wed, Feb 01, 2006 at 04:50:33PM +0000, Dave Howorth wrote: > Aaron Trevena wrote: > >On 01/02/06, Dave Howorth <[EMAIL PROTECTED]> wrote: > >>I have delete buttons on more than one page. So when I press a delete > >>button, I'd like it to redisplay an updated version of the page the > >>delete button was on, rather than always go to the list view for > >>whichever table the delete happened to affect. > >> > >>Does anybody have a way to do this, before I go roll my own? > > > >I haven't needed to do this yet, but I can see that it's something > >you'd want to do. > > > >The easiest way is to include the tablename & template in your form > >arguments, and then check for them and set the template using them if > >appropriate - bearing in mind that the delete action will assume > >'list' would be /table_being_deleted_from/list rather than > >/table_being_viewed/list > > My deletes work the old-fashioned way using the URL path rather than a > form, but I could add extra information. It might perhaps get > complicated passing the information through sub-templates and macros.
I usually just redirect back to the referrer (after a quick sanity check on it), with an optional form field (_new_location) that overrides that if I need to. Very simple approach but works for me. -- Matt S Trout Offering custom development, consultancy and support Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ + ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ Maypole-users mailing list Maypole-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/maypole-users