Looking for a JavaEE Architect or Potential Tech Co-Founder?
Please don't hesitate to contact me.

How to avoid LazyInitializationException when using ManyToMany as value for primefaces selectCheckboxMenu

The idea is to let the component know the type of data source collection.

Sample code:

<p:selectCheckboxMenu value="#{obj.students}" filter="true" filterMatchMode="startsWith">
	<f:attribute name="collectionType" value="java.util.ArrayList" />
	<f:selectItems value="#{elements}" var="elem" itemLabel="#{elem[valueLabelField]}" itemValue="#{elem}" />
</p:selectCheckboxMenu>

Where elements is a list of students.
How to avoid LazyInitializationException when using ManyToMany as value for primefaces selectCheckboxMenu How to avoid LazyInitializationException when using ManyToMany as value for primefaces selectCheckboxMenu Reviewed by Edward Legaspi on Thursday, September 15, 2016 Rating: 5

No comments:

Powered by Blogger.