Class RegistrationWidget


public class RegistrationWidget extends WTemplateFormView
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 Details

  • Method Details

    • remove

      public void remove()
      Description copied from class: WWidget
      Destructor.

      Deletes a widget and all contained contents.

      Overrides:
      remove in class WTemplate
      See Also:
    • setModel

      public void setModel(RegistrationModel model)
      Sets the registration model.
    • getModel

      public RegistrationModel getModel()
      Returns the registration model.

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

    • update

      public void update()
      Updates the user-interface.

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

    • validate

      protected boolean validate()
      Validates the current information.

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

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

    • doRegister

      protected void doRegister()
      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.

    • close

      protected void close()
      Closes the registration widget.

      The default implementation simply deletes the widget.

    • registerUserDetails

      protected void registerUserDetails(User user)
      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.

    • render

      protected void render(EnumSet<RenderFlag> flags)
      Description copied from class: WWidget
      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.

      Overrides:
      render in class WWebWidget
    • createFormWidget

      protected WWidget createFormWidget(String field)
      Description copied from class: WTemplateFormView
      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().

      Overrides:
      createFormWidget in class WTemplateFormView