Redirection with method in Seam
Let's say I have a button:
<h:commandButton value="Assign task"
action="#{taskAssigner.assignTo(user)}"/>
which assigns a new task to a user. I'd like to be able to redirect
immediately to the task page, which would be equivalent to clicking on a
link like
<s:link value="#{task.description}" action="#{workOnTask.start}">
<f:param name="taskId" value="#{task.id}" />
</s:link>
assuming that in WEB-INF/pages.xml I have something like
<page view-id="/task-list.xhtml">
<navigation from-action="#{workOnTask.start}">
<redirect view-id="/task.xhtml"/>
</navigation>
</page>
I can't see how I can do that in Java in TaskAssigner.assignTo(). I would
need access to the Seam component, right? I need to redirect to
/task.xhtml and set param taskId as needed and also run workOnTask.start()
which does some initialization on the component.
No comments:
Post a Comment