CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Select.cc
Go to the documentation of this file.
2 
3 
5 {
6  std::string position = "position:absolute; left:" + get_pix_left() + "; top:" + get_pix_top();
7 
8  // the javascript function makeSelectRequest expects the url of the request and the id of the widget
9  // Example: makeSelectRequest('http://[ApplicationURL]/Request?RequestID=MyCustomRequest', 'select menu 1');
10  std::string applicationURL = get_url();
11  std::string requestName = "RequestID=" + requestID;
12  std::string js_command = "makeSelectRequest('" + applicationURL + "/Request?" + requestName + "'" +
13  ", '" + name + "')";
14 
15  *out << cgicc::div().set("style", position.c_str()) << std::endl;
16 
17  // The id of the form is the name of the select menu + " Form".
18  *out << cgicc::form().set("name", name + " Form").set("id", name + " Form") << std::endl;
19 
20  *out << cgicc::table() << std::endl;
21  *out << cgicc::tr() << std::endl
22  << cgicc::td() << std::endl
23  << name << ":" << std::endl
24  << cgicc::td() << std::endl;
25 
26 
27  *out << cgicc::td() << std::endl;
28  *out << cgicc::select().set("name", name).set("id", name).set("onchange", js_command) << std::endl;
29  *out << cgicc::option().set("value", "").set("selected") << cgicc::option() << std::endl;
30  for (std::vector<std::string>::iterator it = options_v.begin(); it != options_v.end(); it++)
31  {
32  *out << cgicc::option().set("value", *it) << *it << cgicc::option() << std::endl;
33  }
34  *out << cgicc::select() << std::endl;
35  *out << cgicc::td() << std::endl;
36 
37  *out << cgicc::tr() << std::endl;
38 
39  *out << cgicc::table() << std::endl;
40 
41  *out << cgicc::form() << std::endl;
42  *out << cgicc::div() << std::endl;
43 }
44 
45 
std::string get_pix_left()
Definition: WebElement.h:38
list table
Definition: asciidump.py:386
std::string get_url()
Definition: WebElement.h:32
std::string name
Definition: Select.h:18
std::string requestID
Definition: Select.h:19
void printHTML(xgi::Output *out)
Definition: Select.cc:4
std::vector< std::string > options_v
Definition: Select.h:21
tuple out
Definition: dbtoconf.py:99
std::string get_pix_top()
Definition: WebElement.h:37
#define Output(cl)
Definition: vmac.h:193
static int position[264][3]
Definition: ReadPGInfo.cc:509