当我调试列表时说,间接列表未实例化。但是我在 JPA 中偷懒了。它不在 Listview 中呈现,但它应该有节点。我错过了什么吗?
//.....code......
private ListView<String> reqs; // Requirements
private Label lblreqs; //Label for repeat requirements
//...code...
final LigaBaseball lbb = LigaBBServ.buscarPorID(Integer
.parseInt(idLiga)); //Get Baseball league from database
if (lbb == null || pageParameters == null
|| pageParameters.get("idLiga") == null)
throw new RestartResponseException(VerLigas.class); //If null redirect.
//...code...
add(reqs = new ListView<String>("reqs", new ListModel<String>(lbb.getRequisitos()))//LAZYly get List from LigaBaseball(BaseballLeague) {
@Override
protected void populateItem(ListItem<String> item) {
/*When I debug item is null
*/
item.add(lblreqs = new Label("lblreqs", (item.getModelObject())));
}
});
//...code...