-
1. Re: Beginner question - action method and parameters
dhinojosa Jun 8, 2008 8:41 PM (in response to rdc2001)Hey Ryan, Welcome....
In the future can you use the tick marks so that the code can format better? I should look something like this:
@Name("Membership") public class Membership { @In(create=true) private Member member; public String join(Member member) { ... } } @Name("member") public class Member { // to be persisted }
Also, do you have other information? Is the member coming in as null? Is this a single page action? Are the scopes of these objects conversations?
You also need to make sure that parameters are
1.Seam components
2.Should be available on the next request. -
2. Re: Beginner question - action method and parameters
dan.j.allen Jun 10, 2008 3:38 AM (in response to rdc2001)As you learn Seam, there is something very important to remember. The argument that is passed into the method is a context variable. That means, it has to be
in scope
when the method is invoked. If you have to use create=true, that means thatmember
is no longer in scope when the action executes (and Seam has to go create a brand new instance). Likely you need to storemember
in page or conversation scope to ensure it is still around when the action is invoked.