myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject Re: Jsf Hibernate problem in SelectOneList event
Date Thu, 31 Jan 2013 15:52:09 GMT
On 31/01/2013 16:05, Giri Prasad wrote:
> I recently had a problem with jsf+hibernate, with another control from the selectOneXXX
family (see and later)
> My problem was that I was comparing "real" objects and "hibernate proxy" objects. The
standard java equals function just fails in this case. I do not see how you fetch your objects,
but this might be the case.
> Your problem might also be simplier. I am also a bit surprised that you return a list
of SelectItem as value for your f:selectItems.
> Let say that you have a Student type.
> You will then have a
>      List<Student> getStudentList()
> method and a custom Converter to propertly manage the String <-> Object mapping.
> Your selectedItem property should in this case also be of Student type.
> ------------------------
> Thanks for sharing your thoughts.
> I tried the backing bean to use String objects and List<String> for the list box,
since the studentId is a varchar(xx) type in the backend db. The same problem exists, even
now. That is, when only an entry is selected from the list and the <Details> button
pressed, the list empties in the jsf page, the jsf page is refresed, and the "Detail1" function
for the <Detail> button is not being called. This function (Detail1) is called when
the list is empty or when no entry is selected from the list and the when the <Detail>
button is pressed.
> Everything works correctly when Jpa is used for data access in the backing bean. Why
is there the problem in the hibernate-jsf interaction?
Can you share an archive of a simple, ideally buildable with maven, 
subset of your project ?


View raw message