You want to use the model type associated with your component. That is, use the type returned by the call to getModelObject (). So, to use the example from the migration guide:
ListView<Person> peopleListView = new ListView<Person>("people", people) { protected void populateItem(ListItem<Person> item) { item.add(new Link<Person>("editPerson", item.getModel()){ public void onClick() { Person p = getModelObject(); setResponsePage(new EditPersonPage(p)); } }); } };
Using generics, it’s easy to say that this is a list of faces, with a link to an edit page in which a person is used when he is being modeled. Unfortunately, very often at the gate your components will not have a model associated with them. In this case, getModel () will return null, so the appropriate type would be <Void> , which is essentially a place holder for null.
DocumentProcessor
public class DocumentProcessor extends Form implements DocumentManagement { ...
If you do not install a model for DocumentProcessor, it will look like this:
public class DocumentProcessor extends Form<Void> implements DocumentManagement { public DocumentProcessor(String id) { super(id); ....
but with the DocumentProcessor model it looks something like this:
public class DocumentProcessor extends Form<Document> implements DocumentManagement { public DocumentProcessor(String id, Document doc) { super(id, doc);
AjaxFallbackDefaultDataTable
Judging by its constructors, AjaxFallbackDefaultDataTable will most likely save either the IColumn [] model or List in it, but for your implementation you don’t know or don’t care, therefore <?> suitable, the difference between this and DocumentProcessor is re extending form and therefore know and care about how it uses this model.
Icolumn
In the IColumn / PropertyColumn example, I assume that the revisionID field is long, then I would write it like this:
List<PropertyColumn> columns = new ArrayList<PropertyColumn>(); columns.add(new PropertyColumn<Long>(new Model<String>("Number"), "revisionID"));
You can watch
Details 1.4 Migration Information
Type parameter