Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do you use StateHolder interface on Converter?

 
Paul Smiley
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've read the docs and online tutorials - I can't find one that spells out exactly what this does. I have a custom component that I need to have save its state, but I'll be darned if I can figure out what this does by the sparse docs. Just what am I trying to do with these methods?

public Object saveState(FacesContext context) {
// TODO Auto-generated method stub
return null;
}

public void restoreState(FacesContext context, Object state) {
// TODO Auto-generated method stub

}

All of this came about because I couldn't use a SelectItem element - I have to carry an ID from the DB with all of the other display data, which is not unique. So I made a IdSelectItem which extends SelectItem. And of course, JSF wasn't smart enough to render this subclass as a SelectItem, so I had to write a Converter to display the data. And now, it won't save state...
 
Paul Smiley
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone have an idea or a link to give me a push start?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!