How to print from Default List Model
Heya guys so I've got a list of items in a default list model for example
productlist = new ProductList();
productlist.addProduct("01", "Apples", 1.45, "Fresh Green Apples", true);
and I've got everything working but now I've got a button "Print all items"
and it's supposed to print every single item or element in my productlist to screen, or a pop-up window either way I will know how to print them out. But i need a method to get all the elements from the list how do i achieve that? Do i use iterators? Or some one suggested using toString method but I'm not too familiar with them, maybe you guys have more elegant or easier solution?
give me an example, thank you!