When I debug List says, indirect list not instantiated. But I get it fetched lazy in JPA. It is not rendering in Listview but it should have nodes on it. Am I missing something?
//.....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...
Well… according to this (rather minimalist) UnitTest created from your posted code, it does, but maybe I’m missing the point…
Test set: net.unbewaff.DemoTestCase
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.032 sec