CppCMS
Classes | Public Member Functions | Protected Attributes
cppcms::widgets::select_base Class Reference

This is the base class for "select" like widgets which include dropdown lists and radio button sets. More...

#include <cppcms/form.h>

Inheritance diagram for cppcms::widgets::select_base:
cppcms::widgets::base_widget cppcms::base_form booster::noncopyable cppcms::form_flags cppcms::widgets::radio cppcms::widgets::select

List of all members.

Classes

struct  element

Public Member Functions

void add (std::string const &string)
void add (std::string const &string, std::string const &id)
void add (locale::message const &msg)
void add (locale::message const &msg, std::string const &id)
int selected ()
std::string selected_id ()
void selected (int no)
void selected_id (std::string id)
void non_empty ()
virtual void render_input (form_context &context)=0
virtual bool validate ()
virtual void load (http::context &context)
virtual void clear ()

Protected Attributes

std::vector< elementelements_

Detailed Description

This is the base class for "select" like widgets which include dropdown lists and radio button sets.


Member Function Documentation

void cppcms::widgets::select_base::add ( std::string const &  string)

Add a new entry to the selection list.

void cppcms::widgets::select_base::add ( std::string const &  string,
std::string const &  id 
)

Add to the selection list a new entry with the unique identification string id.

void cppcms::widgets::select_base::add ( locale::message const &  msg,
std::string const &  id 
)

Add to the selection list a new localized entry with the unique identification string id.

void cppcms::widgets::select_base::add ( locale::message const &  msg)

Add a new localized entry to the selection list.

virtual void cppcms::widgets::select_base::clear ( ) [virtual]

Clear the form. It also calls set(false).

Reimplemented from cppcms::widgets::base_widget.

virtual void cppcms::widgets::select_base::load ( http::context context) [virtual]

Load the form information from the provided http::context context. A user can call this function to load all information from the raw POST/GET data into the internal widget representation.

Implements cppcms::base_form.

void cppcms::widgets::select_base::non_empty ( )

Require that one item in the list should be selected (for the validation).

virtual void cppcms::widgets::select_base::render_input ( form_context context) [pure virtual]

This is a virtual member function that should be implemented by each widget. It executes the actual rendering of the HTML form.

Implements cppcms::widgets::base_widget.

Implemented in cppcms::widgets::select, and cppcms::widgets::radio.

void cppcms::widgets::select_base::selected ( int  no)

Select the entry numbered no.

int cppcms::widgets::select_base::selected ( )

Return the number of the selected entry in the list. Entries are numbered starting from 0. -1 indicates that nothing was selected.

std::string cppcms::widgets::select_base::selected_id ( )

Return the identification string of the selected entry in the list. An empty string indicates that nothing was selected.

void cppcms::widgets::select_base::selected_id ( std::string  id)

Select the entry with the identification string id.

virtual bool cppcms::widgets::select_base::validate ( ) [virtual]

Validate the form. If not overridden, it sets the widget to valid.

Reimplemented from cppcms::widgets::base_widget.


The documentation for this class was generated from the following file: