0 Replies Latest reply on Jul 1, 2009 8:37 AM by ohughes

    Creating a new Wizard with SEAM

    ohughes

      Hi,


      I have the requirement to create a wizard which will contain a dynamic list of steps, i.e. there are a predefined set of steps, but they can be repeated, performed in any order, etc, and these steps should be able to be removed, and so on.


      If I were to do this with simple java beans then it is fairly trivial, but I think I might need to do it in SEAM, because I am coming from one SEAM HibernateEntitySearch managed page, launching the wizard to create a new set of objects, and then re-directing the user to a HibernateEntityHome managed page, where the user can add more objects to the newly created and saved set of objects.


      Heres a brief explanation of the structure:



      1. There is one HibernateEntityHome seam component which contains a WizardManager (which is a standard java object, containing a collection of steps which have been captured on screen),

      2. This wizard manager then handles the creation of the new set of objects required, and performs the save

      3. Note that the save is done by instantiating a new Hibernate session from the session factory of the HibernateEntityHome containing the Wizard Manager, this has to be a new Session because the session retreived from the component in step 1 is always null



      The problem with this approach is that because when the save is done, I seem to have to invoke a new session to be opened, which then causes the set of objects to be created in a different session than what is used on the Edit page, and then when I perform some modifications on the final page, I then get a NonUniqueObjectException thrown by Hibernate for one of the objects created in the Wizard when I call update.


      Any thoughts?


      Osian