I have a JPA entity Person as person can have many contacts (these are organisations not persons).
On the JSF page I need to display the person and all the contacts. This is what I thought about approaching this.
Problem is that I do not know how can I pass the List<Contact>
(lazy loaded but probably not relevant in context of this question but still mentioning any way) from Person
entity which is inside the PersonBackingBean
has to the ContactsBackingBean
gracefully .
May be my approach is wrong and there should be only one Bean .
I'd create a Controller Bean and prepare the data in it. The data preperation can take place when you process an action when selecting the person to show.
Add two get methods to that controller with one getting the persons and the second one getting the contacts.
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.