Wt: Wt::Ext::FormField Class Reference

Wt 3.3.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions
Wt::Ext::FormField Class Reference
Ext widgets (Wt::Ext, deprecated)

An abstract base class for form fields. More...

`#include <Wt/Ext/FormField>`

Inheritance diagram for Wt::Ext::FormField:
[legend]

List of all members.

## Public Types
enum | MessageLocation { FancyToolTip, PlainToolTip, Below, Besides }
| The location of the validation error message. More...
## Public Member Functions
void | setErrorMessageLocation (MessageLocation location)
| Set the location of the validation error message.
void | setValidator (WValidator *validator)
| Set a validator.
WValidator * | validator () const
| Return the validator.
virtual WValidator::State | validate ()
| Validate the field.
WLabel * | label () const
| Return the label associate with this formfield.
void | setFocus ()
| Give focus to this widget.
virtual void | refresh ()
| Refresh the widget.
EventSignal & | changed ()
| Signal emitted when the value was changed.
EventSignal & | blurred ()
| Signal emitted when the widget lost focus.
EventSignal & | focussed ()
| Signal emitted when the widget recieved focus.
## Protected Member Functions
| FormField (WContainerWidget *parent=0)
| Create a form field.
virtual void | render (WFlags< RenderFlag > flags)
| Renders the widget.

## Detailed Description

An abstract base class for form fields.

## Member Enumeration Documentation

enum Wt::Ext::FormField::MessageLocation

The location of the validation error message.

Enumerator:

  FancyToolTip | Display in a fancy (JavaScript) tool tip.
  PlainToolTip | Display in a plain HTML tool tip.
  Below | Display below the field.
  Besides | Display next to the field.

## Member Function Documentation

WLabel * Wt::Ext::FormField::label | ( |  | ) | const

Return the label associate with this formfield.

Returns the label (if there is one) that acts as a proxy for this widget.

See also:
  WLabel::setBuddy(Ext::FormField *)

void Wt::Ext::FormField::refresh | ( |  | ) | `[virtual]`

Refresh the widget.

The refresh method is invoked when the locale is changed using WApplication::setLocale() or when the user hit the refresh button.

The widget must actualize its contents in response.

Reimplemented from Wt::WWebWidget.

Reimplemented in Wt::Ext::ComboBox.

void Wt::Ext::FormField::render | ( | WFlags< RenderFlag > | flags | ) | `[protected, virtual]`

Renders the widget.

This function renders the widget (or an update for the widget), after this has been scheduled using scheduleRender().

The default implementation will render the widget by serializing changes to JavaScript and HTML. You may want to reimplement this widget if you have been postponing some of the layout / rendering implementation until the latest moment possible. In that case you should make sure you call the base implementation however.

Reimplemented from Wt::WWebWidget.

void Wt::Ext::FormField::setValidator | ( | WValidator * | validator | ) |

Set a validator.

The validator will be used for both client side and server side validation (if it is, or inherits from, one of the four validators provided by Wt: WDateValidator, WDoubleValidator, WIntValidator, WLengthValidator, WRegExpValidator).

If the validator has no parent yet, ownership of the validator is transferred to the form field.

See also:
  validate()

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator