You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

1.4 is the current development release.

Migrating to Wicket 1.4

Bookmarkable URL

Getting and building it

http://wicket.apache.org/building-from-svn.html describes how to get and build Wicket 1.4.x.

Snapshots can be found in this maven repository and has version 1.4-SNAPSHOT:
http://wicketstuff.org/maven/repository

Table of contents

JDK 1.5

Minimum Java version is now 1.5.

getModel name change

The biggest API break is to the getModel() method. In 1.3, Component had a method getModel() that returned the model object of the default model of the component. This was renamed to getDefaultModel(), as well as it's supporting methods (i.e. getDefaultModelObject() and getDefaultModelObjectAsString()). This method returns IModel<?>. This change was made as part of the 1.4-M3 release. In the M1 and M2 releases, getModel() returned IModel<T> because Component had the generic type T. In M3 and subsequent releases, only certain components (including FormComponent and all subclasses, as well as Link and several other core components) were genericized. This included defining them as ComponentName<T> and including a getModel() method that returned IModel<T>.

If you are migrating from 1.3 to 1.4, simply replace getModel() calls with getDefaultModel() wherever your compiler indicates an error for this change.

FileUploadField - now requires model

The FileUploadField now REQUIRES a model. This means that if you previously used the ID-only constructor (i.e. new FileUploadField("myFileField")), you will need to change it to include a model (i.e. new FileUploadField("myFileField", new Model<FileUpload>())). Of course, if you don't do this, FileUploadField will look for a CompoundPropertyModel up the tree as other components do.

Registering a custom string resource loader

The API to register a custom string resource loader (getResourceSettings()#addStringResourceLoader(IStringResourceLoader)) no longer removes the default string resource loaders upon the first add. To make sure that your custom string resource loader is the first to be called use the method getResourceSettings()#addStringResourceLoader(int,IStringResourceLoader).

Spring Support

Spring Modules

wicket-spring and wicket-spring-annot modules have been merged. If your project depends on wicket-spring-annot simply replace it with a dependency on wicket-spring.

If you are using the SpringBean annotation, you need to add wicket-ioc, starting from version 1.4-m2.

SpringWebApplication

SpringWebApplication has been deprecated in favor of SpringBean annotation. See SpringWebApplication javadoc for how to setup SpringBean based injection.

Validators

NumberValidator has been deprecated and broken into three more generic validators: RangeValidator, MinimumValidator, MaximumValidator. Likewise, the corresponding resource keys have also been changed (eg NumberValidator.maximum resource key has become MaximumValidator). NumberValidator.POSITIVE and NEGATIVE have been deprecated without a replacement, they were too confusing to the users with regard to whether or not they included zero - the same result can be easily reproduced by either Minimum or MaximumValidator.

  • No labels