[jboss-user] [JBoss Seam] - Re: Remove from list using EntityHome

lightbulb432 do-not-reply at jboss.com
Fri Feb 16 10:53:27 EST 2007

I was afraid you'd say that :) Just kidding...I actually experimented with a different approach, and it goes about 90% of the way...maybe you could tell me why it isn't working. (Sure I'll end up using the parameters way if this doesn't work, but working through this will help me understand Seam better...)

In my components.xml:

<!-- where myEntityQuery is also defined in this components.xml -->
  | <factory name="myFactory" value="myEntityQuery.dataModel" />

In my xhtml within an h:column:

<h:commandLink value="..." action="#{myEntityHome.remove}" />

In my MyEntityHome:

  | public void setInstance(MyEntity my) {
  |    super.setInstance(my);
  | }

Believe it or not, this setup goes about 90% of the way in my debugger...the "my" parameter gets correctly passed to setInstance, the EntityHome's "instance" variable is set correctly, and the remove method is called while instance is set! But for some reason the entity doesn't get removed, setInstance then gets called a second time before the request is over, this time with null passed to setInstance.

Why might setInstance be getting called twice? I don't think I'm doing anything special apart from what I've indicated above... Please help.

I could try using rowIndex instead of rowData and setting the id instead of the instance, but I'm not sure that would change anything...

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

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

More information about the jboss-user mailing list