[jboss-user] [JBoss Seam] - Re: validation & selectManyListbox

wiberto do-not-reply at jboss.com
Thu Aug 9 18:37:52 EDT 2007


I had a similar issue but not with validating. My equals() method was wrong and always returning false. Blame it on autoboxing!!

anyway, I fixed the equals() and now my checkbox list is selected appropriately based on the objects in the list. Which is a good sign.

But still when I try to submit the form I get this message in the console (I don't see a stack trace or anything else)


  | sourceId=j_id29:j_id60[severity=(ERROR 2), summary=(Error selecting object), detail=(Error selecting object)]
  | 

Here's the tag:

  | <h:selectManyCheckbox layout="pageDirection"	value="#{user.userRoles}">					
  |   					<s:selectItems value="#{rolefinder.refreshedRoles}" var="currentRole"  label="#{currentRole.roleName}"/>
  |   					<s:convertEntity />
  | 				</h:selectManyCheckbox> 
  | 

the userRoles is just a list of Role entities. Which has an @Id field:

  | @Entity
  | @Scope(SESSION)
  | @Name("role")
  | public class Role implements java.io.Serializable 
  | {
  | 	
  | 	private static final long serialVersionUID = 1L;
  | 		
  | 	// Fields
  | 	@Id @GeneratedValue
  | 	@Column(name="role_id")
  | 	private int roleId;
  | 

When the form is submitted I see that the equals method is called a bunch of times (once per item) but then the error message pops up.

I'm running 1.2.1GA with AS 4.2.0GA

Thanks!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072761#4072761

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072761



More information about the jboss-user mailing list