I believe company.category should be a list.
You will also have a problem in that JSF passes an Arrays$ArrayList to the
setter. I would advise that you keep you company.category and remove the
missing (from the new list) items and add the newly selected items. Otherwise
you will have a
Actually I wrote about selectManyListBox.
If company.category can be a set (I'm not sure about that) shouldn't you at
least provide an empty set object?
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4086155#4086155
Reply to the post :
Hello,
I just changed the attribute to List as suggested but the error is still the
same. Any other ideas?
Thanks
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4086163#4086163
Reply to the post :
The preselection is determined by the value of the property in the Bean - ie.
if carsBean.car is a list of Cars then those that are present in that list will
be 'pre-selected' in your selectManyCheckbox.
You can use s:convertEntity but have a read of Chapter 28 of the Seam Reference
manual
Thanks, actually this is the code I already have. It works fine, the only
problem is that my checkboxes are not pre-selected with the current list
status. It drives me crazy:
h:selectManyCheckbox value=#{client.paymentmethods} required=true
layout=pageDirection
| s:convertEntity /
|
Oh, and user tompom = JUnkie ;-)
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4069106#4069106
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4069106
___
jboss-user mailing list
This does 'just work' - every value which .equals a selectItem value will be
selected. Post client. And make sure that client.paymentmethods is returning
the correct list.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4069203#4069203
Reply to the post :
Thanks Pete.
For me it works only one way: My selection is saved correctly to the db. If I
select a single item my console says:
17:10:08,551 INFO [STDOUT] Hibernate:
| delete
| from
| clients_paymentmethods
| where
| clients_id=?
|
|
Well Seam 1.2.1.GA is targetted at JBoss AS 4.0.5.GA but I doubt this is the
problem. So, put a breakpoint on the getter for client.paymentmethods and see
whether the correct list is being returned. Don't just assume that because the
data in the database, it is loaded correctly.
View the
Thanks again Pete.
I have made sure that Client.getPaymentmethods() is called and returns the
correct list. It is called for each item in allPaymentMethods.resultList. So if
there are three items in allPaymentMethods.resultList the following debug
version of Client.getPaymentmethods() returns
So you need to make sure that the item in the entity query .equals() the item
in the selectXXX. If you are using conversation scope and SMPCs all the way,
this just works, otherwise, try implementing and .equals method on the entity ,
break on it, and see what is going on.
View the original
I have the same problem with all my other controls. Until now I only needed
several h:selectOneMenu and could therefore work around the issue by just
adding one single f:selectItem followed by s:selectItems as below.
f:selectItem just works for me and pre-selects the last selection.
I changed all my session beans to make use of a SMPC. Does not help, my
checkboxes are still empty (same with all my drop down boxes if I don't work
with f:selectItem).
I'll try the .equals() method.
View the original post :
This would be a safer and more generic equals() method that does not have to be
changed for different entities.
public boolean equals(Object o){
return (o != null (this.getClass().cast(o)).getId() == this.getId());
}
Have fun.
View the original post :
Yeah, I know the exact problem, in fact, its a oft discussed topic when using
hibernate. There is something on the SeamProblemsFAQ about this (but not
coming from your angle, I will update).
When you load the same entity twice from the same persistence context the same
object is returned. If
Thanks,
that's very interesting as I thought the objects are equal although they come
from different PCs, I thought they are just not identical.
Two different objects having the exact same state (same property values) can be
considered as equal I thought. From that perspective my objects were
Yes, there is a mismatch between expectation and reality here ;)
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4069319#4069319
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4069319
17 matches
Mail list logo