Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: FormComponentUpdatingBehavior

...

All AjaxFallback** components and the containers which use internally AjaxFallback** components, like AjaxTabbedPanel, RatingPanel and TableTree, have been reworked to pass Optional<AjaxRequestTarget> instead of just AjaxRequestTarget to their onXyz() callback methods. This way the application developer should not forget to check that the AjaxRequestTarget is not null. 

AbstractChoice#getChoices() is 'final' now  
Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyWICKET-6132

AbstractChoice#getChoices() has been made final. If the application needs to provide different choices for each render then it should override AbstractChoice#getChoicesModel() instead. The application code would be almost the same as before, it will just need to wrap the final List result in an IModel, most probably ListModel.

ListenerInterfaceRequestHandler simplification
Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyWICKET-6137

RequestListenerInterface was removed:

  • IResourceListener, IBehaviorListener, IOnChangeListener, ILinkListener are replaced by the generic method IRequestListener#onRequest()
  • ListenerInterfaceRequestHandler was renamed to ListenerRequestHandler
  • Component's and Behavior's #canCallListenerInterface() were renamed to #canCallListener()
  • PageSettings#getCallListenerInterfaceAfterExpiry() was renamed to #getCallListenerAfterExpiry.

A Component or Behavior can now implement IRequestListener once only, thus removing the need to include an identifier (e.g. "ILinkListener") in the URL.

wantOnSelectionChangedNotifications moved to FormComponentUpdatingBehavior 
Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyWICKET-6348

Change notification was moved from CheckBox, DropDownChoice, RadioChoice, CheckGroup/Check and RadioGroup/Radio into a new behavior FormComponentUpdatingBehavior.

Instead of subclasses the component, this behavior can now be added to the component:

Code Block
languagejava
titleFormComponentUpdatingBehavior
// Wicket 7.x
new CheckBox("id", model) {
	protected boolean wantOnSelectionChangedNotifications() {
		return true;
        }

	protected void onSelectionChanged(Boolean newSelection) {
		// do something, page will be rerendered;
	}
};


// Wicket 8.x
new CheckBox("id", model)
.add(new FormComponentUpdatingBehavior() {
	protected void onUpdate() {
		// do something, page will be rerendered;
	}

    protected void onError(RuntimeException ex) {
        super.onError(ex);
    }
});

As with AjaxFormComponentUpdatingBehavior any error during processing of the form component can now be handled in #onError().

Behavior changes

FormComponentPanel delegates the call to #clearInput to its FormComponent children 
Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyWICKET-6114

...