Wt  3.3.0
Public Member Functions | Protected Member Functions
Wt::Auth::RegistrationWidget Class Reference

A registration widget. More...

#include <Wt/Auth/RegistrationWidget>

Inheritance diagram for Wt::Auth::RegistrationWidget:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 RegistrationWidget (AuthWidget *authWidget=0)
 Constructor.
void setModel (RegistrationModel *model)
 Sets the registration model.
RegistrationModelmodel () const
 Returns the registration model.
void update ()
 Updates the user-interface.

Protected Member Functions

virtual bool validate ()
 Validates the current information.
virtual void doRegister ()
 Performs the registration.
virtual void close ()
 Closes the registration widget.
virtual void registerUserDetails (User &user)
 Registers more user information.
virtual void render (WFlags< RenderFlag > flags)
 Renders the widget.
virtual WFormWidgetcreateFormWidget (RegistrationModel::Field field)
 Creates a form widget.

Detailed Description

A registration widget.

This implements a widget which allows a new user to register. The widget renders the "Wt.Auth.template.registration" template. and uses a RegistrationModel for the actual registration logic.

Typically, you may want to specialize this widget to ask for other information.


Constructor & Destructor Documentation

Wt::Auth::RegistrationWidget::RegistrationWidget ( AuthWidget authWidget = 0)

Constructor.

Creates a new authentication.


Member Function Documentation

void Wt::Auth::RegistrationWidget::close ( ) [protected, virtual]

Closes the registration widget.

The default implementation simply deletes the widget.

WFormWidget * Wt::Auth::RegistrationWidget::createFormWidget ( RegistrationModel::Field  field) [protected, virtual]

Creates a form widget.

This method is called by updateViewField() when it needs to create a form widget for a field, and none was specified using setFormWidget().

Reimplemented from Wt::WTemplateFormView.

void Wt::Auth::RegistrationWidget::doRegister ( ) [protected, virtual]

Performs the registration.

The default implementation checks if the information is valid with validate(), and then calls RegistrationModel::doRegister(). If registration was successful, it calls registerUserDetails() and subsequently logs the user in.

RegistrationModel* Wt::Auth::RegistrationWidget::model ( ) const

Returns the registration model.

This returns the model that is used by the widget to do the actual registration.

void Wt::Auth::RegistrationWidget::registerUserDetails ( User user) [protected, virtual]

Registers more user information.

This method is called when a new user has been successfully registered.

You may want to reimplement this method if you've added other information to the registration form which needs to be annotated to the user.

void Wt::Auth::RegistrationWidget::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::Auth::RegistrationWidget::update ( )

Updates the user-interface.

This updates the user-interface to reflect the current state of the model.

bool Wt::Auth::RegistrationWidget::validate ( ) [protected, virtual]

Validates the current information.

The default implementation simply calls RegistrationModel::validate() on the model.

You may want to reimplement this method if you've added other information to the registration form that need validation.

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator

Generated on Mon Apr 8 2013 for the C++ Web Toolkit (Wt) by doxygen 1.7.5.1