CMS 3D CMS Logo

Select Class Reference

This is the class that should be instantiated in case the user wants to have a select menu, the elements of which, submit a request when clicked on. More...

#include <DQM/TrackerCommon/interface/Select.h>

Inheritance diagram for Select:

WebElement WebElement

List of all members.

Public Member Functions

void printHTML (xgi::Output *out)
void printHTML (xgi::Output *out)
 Select (std::string the_url, std::string top, std::string left, std::string the_requestID, std::string the_name)
 Select (std::string the_url, std::string top, std::string left, std::string the_requestID, std::string the_name)
void setOptionsVector (std::vector< std::string > the_options_v)
void setOptionsVector (std::vector< std::string > the_options_v)
 ~Select ()
 ~Select ()

Private Attributes

std::string name
std::vector< std::string > options_v
std::vector< std::string > options_v
std::string requestID


Detailed Description

This is the class that should be instantiated in case the user wants to have a select menu, the elements of which, submit a request when clicked on.

Definition at line 14 of file Select.h.


Constructor & Destructor Documentation

Select::Select ( std::string  the_url,
std::string  top,
std::string  left,
std::string  the_requestID,
std::string  the_name 
) [inline]

Definition at line 25 of file Select.h.

References name, and requestID.

00027     : WebElement(the_url, top, left)
00028     {
00029       name = the_name;
00030       requestID = the_requestID;
00031     }

Select::~Select (  )  [inline]

Definition at line 33 of file Select.h.

00034     {
00035     }

Select::Select ( std::string  the_url,
std::string  top,
std::string  left,
std::string  the_requestID,
std::string  the_name 
) [inline]

Definition at line 25 of file Select.h.

References name, and requestID.

00027     : WebElement(the_url, top, left)
00028     {
00029       name = the_name;
00030       requestID = the_requestID;
00031     }

Select::~Select (  )  [inline]

Definition at line 33 of file Select.h.

00034     {
00035     }


Member Function Documentation

void Select::printHTML ( xgi::Output *  out  )  [virtual]

Implements WebElement.

void Select::printHTML ( xgi::Output *  out  )  [virtual]

Implements WebElement.

Definition at line 4 of file Select.cc.

References lat::endl(), WebElement::get_pix_left(), WebElement::get_pix_top(), WebElement::get_url(), it, name, btag::LeptonSelector::option(), options_v, requestID, dummy::select(), edm::table, and getDQMSummary::td.

00005 {
00006   std::string position = "position:absolute; left:" + get_pix_left() + "; top:" + get_pix_top();
00007 
00008   // the javascript function makeSelectRequest expects the url of the request and the id of the widget
00009   // Example: makeSelectRequest('https://[ApplicationURL]/Request?RequestID=MyCustomRequest', 'select menu 1');
00010   std::string applicationURL = get_url();
00011   std::string requestName    = "RequestID=" + requestID;
00012   std::string js_command = "makeSelectRequest('" + applicationURL + "/Request?" + requestName + "'" + 
00013     ", '" + name + "')";
00014 
00015   *out << cgicc::div().set("style", position.c_str()) << std::endl;
00016 
00017   // The id of the form is the name of the select menu + " Form".
00018   *out << cgicc::form().set("name", name + " Form").set("id", name + " Form") << std::endl;
00019 
00020   *out << cgicc::table() << std::endl;
00021   *out << cgicc::tr() << std::endl
00022        << cgicc::td() << std::endl
00023        << name << ":" << std::endl
00024        << cgicc::td() << std::endl;
00025 
00026 
00027   *out << cgicc::td() << std::endl;
00028   *out << cgicc::select().set("name", name).set("id", name).set("onchange", js_command) << std::endl; 
00029   *out << cgicc::option().set("value", "").set("selected") << cgicc::option() << std::endl;
00030   for (std::vector<std::string>::iterator it = options_v.begin(); it != options_v.end(); it++)
00031     {
00032       *out <<  cgicc::option().set("value", *it) << *it << cgicc::option() << std::endl;
00033     }
00034   *out << cgicc::select() << std::endl;
00035   *out << cgicc::td() << std::endl;
00036 
00037   *out << cgicc::tr() << std::endl;
00038 
00039   *out << cgicc::table() << std::endl;
00040 
00041   *out << cgicc::form() << std::endl;
00042   *out << cgicc::div() << std::endl;
00043 }

void Select::setOptionsVector ( std::vector< std::string >  the_options_v  )  [inline]

Definition at line 37 of file Select.h.

References options_v.

00038     {
00039       options_v = the_options_v;
00040     }

void Select::setOptionsVector ( std::vector< std::string >  the_options_v  )  [inline]

Definition at line 37 of file Select.h.

References options_v.

00038     {
00039       options_v = the_options_v;
00040     }


Member Data Documentation

std::string Select::name [private]

Definition at line 18 of file Select.h.

Referenced by printHTML(), and Select().

std::vector<std::string> Select::options_v [private]

Definition at line 21 of file Select.h.

std::vector<std::string> Select::options_v [private]

Definition at line 21 of file Select.h.

Referenced by printHTML(), and setOptionsVector().

std::string Select::requestID [private]

Definition at line 19 of file Select.h.

Referenced by printHTML(), and Select().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:31:16 2009 for CMSSW by  doxygen 1.5.4