....
@SpringBean
private ProductManager productManager;
//@Autowired
public void setProductManager(ProductManager productManager) {
this.productManager = productManager;
}
.....
LoadableDetachableModel personListModel = new LoadableDetachableModel() {
@Override
protected Object load() {
return productManager.getProducts();
}
};
add(new ListView("products", personListModel) {
........
});
It's ok.
While if a use an external class:
package wicketapp.util;
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.spring.injection.annot.SpringBean;
import springapp.service.ProductManager;
public class ProductModel extends LoadableDetachableModel {
@SpringBean
private ProductManager productManager;
//@Autowired
public void setProductManager(ProductManager productManager) {
this.productManager = productManager;
}
protected Object load() {
return productManager.getProducts();
}
}
..........
ProductModel personListModel = new ProductModel();
add(new ListView("products", personListModel) {
.......
});
It's wrong.
Which is the problem?
--
View this message in context:
http://www.nabble.com/Problem-on-external-LoadableDetachableModel-class-tp18797009p18797009.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]