aspose file tools*
The moose likes JBoss/WildFly and the fly likes Seam: Where you from!? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Seam: Where you from!?" Watch "Seam: Where you from!?" New topic
Author

Seam: Where you from!?

Ryan Waggoner
Ranch Hand

Joined: Jun 27, 2007
Posts: 75
Hey guys,
I am having trouble trying to find out how to do something like:



Anyone know how to make my pseudo code come to life with Seam?

Thanks!
Vivek Murugesan
Greenhorn

Joined: Apr 09, 2009
Posts: 9




The return type is a string from an action.

In pages.xml , you can define the navigation as,



Let me know if this helps!!
Ryan Waggoner
Ranch Hand

Joined: Jun 27, 2007
Posts: 75
That looks like what I want Vivek...


But how do you get the strPage?

Or rather when I call the redirect method, where am I calling it from, and what do I pass in?
Vivek Murugesan
Greenhorn

Joined: Apr 09, 2009
Posts: 9
What's your scenario? I thought you have an action method and based on it's logic you have to navigate to the corresponding page.

check this link for more info, http://shrubbery.mynetgear.net/wiki/Seam_pages.xml
Ryan Waggoner
Ranch Hand

Joined: Jun 27, 2007
Posts: 75
I have a userList page, which lists all of my users. You can click a user, then edit & save them.
I have an add/edit user page, which does just that. When you save the add/edit, you are forwarded to a confirmation page.

I am trying to figure out how:

When someone clicks the save
If they came from the userList page, send them back.
If they came from anywhere else, send them to the confirmation page.

The save button is linked to a method in my stateful bean, userEntryBean.

Maybe I can ask, how, in my code, can I see where the person navigated from.

Any ideas?

Thanks!
Vivek Murugesan
Greenhorn

Joined: Apr 09, 2009
Posts: 9
A simple approach would be to set a boolean value in a bean and based on the value you can redirect, it can be set to 'true' when navigating from userList page.

or

You can refer the API,org.jboss.seam.faces.Redirect -> Redirect.instance().captureCurrentView();

and you'll have to make corresponding navigational entries in pages.xml.



Ryan Waggoner
Ranch Hand

Joined: Jun 27, 2007
Posts: 75
I think I will be going the boolean route.

Thanks a lot for the help!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Seam: Where you from!?
 
Similar Threads
Seam in Action: Can I mix Seam controls with non-seam JSF Controls
Prefer Seam over Spring
Migration From seam 2.1 to seam 3.0
@ManagedBean Annotation JSF2
Annoying view expired error