• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

JSF Tomahawk - t:saveState

Ranch Hand
Posts: 146
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all.

I've got a little problem using tomahawk saveState tag, but I've solved the problem. But I'd like to know some underlying concepts to understand what happened at this situation.

Well, I have the following scenario:
- a managed bean that represents a domain object named (Project).
- a backing bean that represents the view for registering projects named (RegisterProjectMb).

Both beans was defined in my faces-config.xml file.

The RegisterProjectMb has a property project with an instance of Project (injected by JSF managed bean facility).

The Problem:
When registering a project the user will be sent to another view to insert more data, so if the user wants to get back to the first page, I'd like that the Project related data can still be presented to the user.
But I don't want to define my Project bean with session scope.

So I use f:saveState as follows:

I've declared the above tag inside my two views: registerProject.xhtml and registerProject2.xhtml, and I was getting an empty project when moving back to the first view.

After one hour trying to solve this, I declared the saveState to my BackingBean too as follows (and must be declared in the same order as follows):

So, now, my code is working well, but why saving the state of the project or even the registerProjectMb alone does not work?

Could anyone help me to understand it?

Thanks in advance.

A "dutch baby" is not a baby. But this tiny ad is baby sized:
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic