0

I'm trying to pass an object to another site. So i have my Gallery.xhtml where I set an object as current and redirect to another page:

<h:form>
        <a4j:commandButton value="Edit Skin"
            action="#{helloBean.setCurrentSkin(skin)}"
            onclick="window.location.href = 'resources/html/Editor.xhtml';" />
</h:form>

But when the getter on the second page is called, the current object is null again.

Is the bean generated for each page? How could I achieve this?

4ndro1d
  • 2,926
  • 7
  • 35
  • 65

1 Answers1

0

My Problem was that I declared my bean as @ViewScoped, but the proper Tag is @SessionScoped. This makes sure that the Bean holds its values for the whole session and not only one view.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
4ndro1d
  • 2,926
  • 7
  • 35
  • 65