« Return to Thread: Creating a BeanTable from a Collection of java beans

Re: Creating a BeanTable from a Collection of java beans

by wfaler :: Rate this Message:

Reply to Author | View in Thread

Hi,
As you might already have worked out partially already, you should use one of the PropertyTable implementations, such as AjaxBeanPropertyTable.
Apart from calling the constructor, you also need to call the init() method with an implementation of a PropertyTableProvider (which is responsible of the retrieving of the collection of beans, a default impl is available in DefaultBeanPropertyTableProvider for JPA, although there is an inheritance bug in this, which has been fixed in SVN, but is not yet released).

Finally, your beans getter-methods should have annotations from the org.wicketrad.propertytable.annotation package, such as @LabelProperty for just a simple label, @BookmarkableLinkProperty if you want the property to be displayed as a bookmarkable link in the table, or a @BeanLinkProperty for a stateful link that will pass in the current bean itself as an argument to the Page it links to.

Hope that helps!

wadi wrote:
Hi all! I would like to  know how to use wicket rad to display a table with a given collection of Beans and how to specify the attributes to show in every column.
Thanks in advance,
Wadi

 « Return to Thread: Creating a BeanTable from a Collection of java beans