1# $Id: fr_select.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
2# ========================================================================
3# Copyright 2006 University of Washington
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#     http://www.apache.org/licenses/LICENSE-2.0
10#
11# ========================================================================
12
13#  fr_select.tcl
14#
15#  Purpose:  CGI script to generate frame set for selecting by the various methods
16#	     in webpine-lite pages.  the idea is that this
17#            page specifies a frameset that loads a "header" page
18#            used to keep the servlet alive via
19#            periodic reloads and a "body" page containing static/form
20#            elements that can't/needn't be periodically reloaded or
21#            is blocked on user input.
22
23#  Input:
24set frame_vars {
25  {uid		""	0}
26}
27
28#  Output:
29#
30
31## read vars
32foreach item $frame_vars {
33  if {[catch {cgi_import [lindex $item 0].x}]} {
34    if {[catch {eval WPImport $item} errstr]} {
35      error [list _action "Impart Variable" $errstr]
36    }
37  } else {
38    set [lindex $item 0] 1
39  }
40}
41
42
43cgi_http_head {
44  WPStdHttpHdrs
45}
46
47cgi_html {
48  cgi_head {
49  }
50
51  cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
52
53    set parms ""
54    if {[info exists frame_vars]} {
55      foreach v $frame_vars {
56	if {[string length [subst $[lindex $v 0]]]} {
57	  if {[string length $parms]} {
58	    append parms "&"
59	  } else {
60	    append parms "?"
61	  }
62
63	  append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
64	}
65      }
66    }
67
68    cgi_frame subhdr=header.tcl?title=104 title="Status Frame"
69    cgi_frame subbody=select.tcl${parms} title="Search Criteria"
70  }
71}
72