// Set the ListModel.
getPlwOrders().init(soOrder, listBoxOrder, paging_OrderList);
// get the first object and poll and show the orderpositions
ListModelList lml = (ListModelList) listBoxOrder.getModel();
if (lml.size() > 0) {
Order anOrder = (Order) lml.get(0);
if (anOrder != null) {
HibernateSearchObject<Orderposition> soOrderPosition = new HibernateSearchObject<Orderposition>(Orderposition.class, getPageSizeOrderPositions());
soOrderPosition.addFilter(new Filter("order", anOrder, Filter.OP_EQUAL));
// deeper loading of the relation to prevent the lazy
// loading problem.
soOrderPosition.addFetch("article");
getPlwOrderpositions().init(soOrderPosition, listBoxOrderArticle, paging_OrderArticleList);
}
} else {
// get a new Order for searching that the resultList is cleared
// Order anOrder = getOrderService().getNewOrder();
// HibernateSearchObject<Orderposition> soOrderPosition = new
// HibernateSearchObject<Orderposition>(Orderposition.class,
// getPageSizeOrderPositions());
// soOrderPosition.addFilter(new Filter("order", anOrder,
// Filter.OP_EQUAL));
// // deeper loading of the relation to prevent the lazy
// // loading problem.
// soOrderPosition.addFetch("article");
//
// getPlwOrderpositions().init(soOrderPosition,
// listBoxOrderArticle, paging_OrderArticleList);
// Bugfix: sge 18/11/2011
ListModelList lml2 = (ListModelList) listBoxOrder.getModel();
lml2.clear();
}
}
// close the bandbox