2 Replies Latest reply on Jul 31, 2007 4:10 AM by uke

    Changing SESSION-scoped instance in entityhome

    uke

      Hi!

      I've got a declaratively created entity-home component "fooDao".
      And also a factory for instances of its entity class:

      <factory name="foo" scope="SESSION" value="#{fooDao.instance}/>


      The user selects an instance from a list (which sends the id as a parameter to a view page, as specified in my components.xml) and everything works great.

      The problem arises when a user comes back to the list a second time in the same session. At that point, it doesn't matter which link the user presses, the 'foo' variable remains the instance that was loaded the first time around, rather than being set to the instance with the new selected id.

      Is there an easy solution for this?

      Thanks,
      Sebastian

        • 1. Re: Changing SESSION-scoped instance in entityhome

          If you don't want the value to exist throughout the entire session, why put in the session? Perhaps you should make it request scope so that it will be evaluated once per request, if needed?

          • 2. Re: Changing SESSION-scoped instance in entityhome
            uke

            Thanks for your response. Sorry I haven't been able to get back to you sooner.

            "Putting it in the request scope" equals using request parameters throughout the page, right? Is there an easy way to do this, ie does s:link for example have an option to forward existing page parameters automatically, or do I have to add param-tags to all the links?
            Also, for links that should be clickable both when this variable is set, and when it's not .. how do I solve this?

            I tried putting it all in a conversation instead, but then the problem of the variable not being updated remained.

            /Sebastian