Scenario: I am creating Projects and Issues under those projects and have a
question about passing the projectid around.

Project.tml
        <t:PageLink page="issue/CreateIssue" context="${project.id}">Create
New Issue</t:PageLink>

CreateIssue.tml
        <t:BeanEditForm t:id="issue" object="newIssue"
submitLabel="message:submitCreateIssueText" exclude="id" add="project">
            <t:Parameter name="project">
                <input name="projectId" value="${project.id}"/>
            </t:Parameter>
        </t:BeanEditForm>

Q1: notice, I have to add the projectId parameter. Also, 'newIssue' does NOT
have a projectId field. Submitting this form takes me to onSuccess where I'd
like to to retrieve the Project, create the Issue, call
issue.setProject(project) and then save the issue. But how do I retrieve the
projectId field since it is not part of my Issue entity?

Q2: after saving the new Issue, I'd like to return to the project screen. To
do that, I'd like to forward to a page/handler by passing the 'projectId'
again. How do I do that from onSuccess? I return a class - but how do I
include a parameter?

I think I am missing something. onActivate works when I am rendering a page
- but I'm not sure what similar method gets called while Posting ... and
before onSuccess where I can pull off the projectId.

Furthermore, is there a lifecycle method I can implement that would attach
projectId to the request so that the following page can get it? Maybe during
onPassivate? Just not sure how to pass it.

Thanks for any suggestions,

-Luther

Reply via email to