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

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.




- Hibernate - Get Classes That Referenced A Given Entity
There are times when we want to list the entities that referenced (via foreign keys) a given entity x. For example, when deleting entity x that is being referenced, it will throw a generic ConstraintViolationException. Oftentimes, we need to display this...

- How To Implement No Caching On Jsf Pages
Currently there are 2 ways I know that can do this. 1.) By implementing Filter and manually overriding the cache controls. See code below (note: not my original I found this somewhere else long time ago): @WebFilter(servletNames = { "Faces Servlet" })...

- How To Use Primefaces With Jboss 7.1.3
This tutorial will teach us how to use primefaces with jboss 7.1.3. Requirements:  1.) primefaces 3.5  2.) jboss 7.1.3  3.) maven javaee6 generated project (ear, war, ejb) Steps: 1.) Add primefaces module in jboss.   a.) In JBOSS_HOME/modules...

- Html Scraping With Java
One rainy Sunday afternoon since I can't get out to go somewhere I've decided to create an organized excel file (for now) for the list of birds commonly found in the Philippines. I found a good site to start with, http://www.birding2asia.com/tours/reports/PhilFeb2010_list.html,...

- Mvc3 Ajax Validation Doesn't Work On A Jquery Served Form
To make automatic validation using data annotation on a model on mvc3 c# we need: 1.) A model with data annotation (ex. required attribute). 2.) Form with jquery declaration (jquery1.7, validate, validate unobtrusive, and unobtrusive-ajax. All are available...



Tech-Today








.