Custom pages

In the vast majority of cases customization should be sufficient by replacing elements of a page. However, it is also possible to define an entirely new page for a given page type.

The Wicket viewer defines these page types (see the org.apache.causeway.viewer.wicket.model.models.PageType enum):

Table 1. PageType enum
Page type Renders

SIGN_IN

The initial sign-in (aka login) page

SIGN_UP

The sign-up page (if user registration is enabled).

SIGN_UP_VERIFY

The sign-up verification page (if user registration is enabled; as accessed by link from verification email)

PASSWORD_RESET

The password reset page (if enabled).

HOME

The home page, displaying either the welcome message or dashboard

HOME_AFTER_PAGETIMEOUT

Variation on home page after a timeout.

ABOUT

The about page, accessible from link top-right

ENTITY

Renders a single entity or view model

STANDALONE_COLLECTION

Page rendered after invoking an action that returns a collection of entites

VALUE

After invoking an action that returns a value type (though not URLs or Blob/Clobs, as these are handled appropriately automatically).

VOID_RETURN

After invoking an action that is void

ACTION_PROMPT

(No longer used).

The PageClassList interface declares which class (subclass of org.apache.wicket.Page is used to render for each of these types. For example, Apache Causeway' WicketSignInPage renders the signin page.

To specify a different page class, create a new implementation of PageClassList and annotate with an earlier precedence than the default. If you are just tweaking the defaults, then its easiest to override PageClassListDefault:

@Service
@Priority(PriorityPrecedence.EARLY)
public class MyPageClassList extends PageClassListDefault {
    protected Class<? extends Page> getSignInPageClass() {
        return MySignInPage.class;
    }
}