CMS 3D CMS Logo

Button Class Reference

This is the class that should be instantiated in case the user wants to have a button on the web page, which is connected to a function defined in your web client. More...

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

Inheritance diagram for Button:

WebElement WebElement

List of all members.

Public Member Functions

 Button (std::string the_url, std::string top, std::string left, std::string the_requestID, std::string the_name)
 Button (std::string the_url, std::string top, std::string left, std::string the_requestID, std::string the_name)
void printHTML (xgi::Output *out)
void printHTML (xgi::Output *out)
 ~Button ()
 ~Button ()

Private Attributes

std::string name
 the name that will appear on the button
std::string requestID
 the string connected to the callback, eg "Default"


Detailed Description

This is the class that should be instantiated in case the user wants to have a button on the web page, which is connected to a function defined in your web client.

Pressing this button will result in the javascript function makeRequest being called and the request "/Request?RequestID=[Your request name]" being submitted to the server.

Definition at line 18 of file Button.h.


Constructor & Destructor Documentation

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

Definition at line 28 of file Button.h.

References name, and requestID.

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

Button::~Button (  )  [inline]

Definition at line 35 of file Button.h.

00036     {
00037     }

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

Definition at line 28 of file Button.h.

References name, and requestID.

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

Button::~Button (  )  [inline]

Definition at line 35 of file Button.h.

00036     {
00037     }


Member Function Documentation

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

Implements WebElement.

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

Implements WebElement.

Definition at line 4 of file Button.cc.

References lat::endl(), WebElement::get_pix_left(), WebElement::get_pix_top(), WebElement::get_url(), iggi_31X_cfg::input, name, and requestID.

00005 {
00006   std::string position = "position:absolute; left:" + get_pix_left() + "; top:" + get_pix_top();
00007   *out << cgicc::div().set("style", position.c_str()) << std::endl;
00008 
00009   std::string js_command = "makeRequest('" + get_url() + "/" + "Request?RequestID=" + requestID + "', dummy)";
00010   *out << cgicc::input().set("type", "button")
00011     .set("value", name.c_str())
00012     .set("onclick", js_command.c_str()) << std::endl;
00013 
00014   *out << cgicc::div() << std::endl;
00015 }


Member Data Documentation

std::string Button::name [private]

the name that will appear on the button

Definition at line 22 of file Button.h.

Referenced by Button(), and printHTML().

std::string Button::requestID [private]

the string connected to the callback, eg "Default"

Definition at line 24 of file Button.h.

Referenced by Button(), and printHTML().


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