简体   繁体   中英

JSF editable datatable for JPA beans, one size fits all

I would like to have a JSF page with an editable datatable to provide basic CRUD capability for a assorted number of JPA-enabled beans.

How to do it for a specific class, is already done: http://forum.primefaces.org/viewtopic.php?f=3&t=9026

My question: how can I populate the datatables for the JPA beans without knowing what bean I am going to edit before runtime? How do I pass the bean fields to the datatable without creating a separate page for each bean (around 10 at the time of this writing).

Take a Look at tools for rapid development with scaffolding support, such as JBoss Forge ( JSF Scaffolding by default) and Spring Roo (Very good JSF Add-on ).

These are not exactly what you are looking for (a monolithic generic view component that handles everything), but will generate simple CRUDS in seconds and handle most of the boilerplate code and repetitive tasks. The end result is fairly maintainable and modular code which programmers can (relatively) easy improve and take finer-grained control of when they have to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM