[jboss-user] [JBoss Seam] - Setting the pageflow dinamically when stating a conversation
rlhr
do-not-reply at jboss.com
Fri Aug 4 05:18:33 EDT 2006
Hello,
I have a use case that requires me to start different pageflow depending on the context.
One obvious solution is to define as many starting methods with the right annotation and call the according method
@Begin(pageflow = "flow1")
| public void startFlow1() {
| ...
| }
|
| @Begin(pageflow = "flow2")
| public void startFlow2() {
| ...
| }
|
That would be fine for just 2 pageflows. But if the number of pageflow grows, that could become a little annoying to have to write a new method each time. Also it is not really flexible and robust.
So I thought of the following solution:
@Begin
| public void start(String flowDefinitionName) {
| // whatever has to be done before starting the flow
| ...
|
| Pageflow.instance().begin(flowDefinitionName);
| }
|
In that case, the same method is always called and we just pass the right pageFllow definition.
It seems to work but I would like to know if someone sees anything wrong with this? Is there even a better wat of doing this?
Thanks
Richard
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963119#3963119
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963119
More information about the jboss-user
mailing list