Index: openacs-4/packages/acs-templating/www/doc/demo/list5/view-one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/list5/view-one.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/www/doc/demo/list5/view-one.tcl 27 Oct 2014 16:40:20 -0000 1.2 +++ openacs-4/packages/acs-templating/www/doc/demo/list5/view-one.tcl 7 Aug 2017 23:48:02 -0000 1.3 @@ -7,8 +7,18 @@ context:onevalue title:onevalue body:onevalue +} -validate { + valid_note_id -requires template_demo_note_id { + if {![db_0or1row note_exists { + select 1 from template_demo_notes + where template_demo_note_id = :template_demo_note_id + }]} { + ad_complain "Invalid note ID" + } + } } + set context [list "One note"] db_1row note_select { @@ -20,3 +30,9 @@ set body [ad_text_to_html -- $body] ad_return_template + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: