On Wednesday, November 5, 2003, at 12:02 PM, Reinhard Poetz wrote:



From: Jeremy Quinn


On Tuesday, November 4, 2003, at 01:43 PM, Reinhard Poetz wrote:

catch (break) {
// a continuation has been started
   }
   catch (continue) {
// a continuation has been resumed
   }
}

IIRC catch(break) is must be used as "top-level" statement

I think this is why they did not work before


(... but this is only a guess - never tried catch(continue) but
catch(break)
works for me.)

They both work for me too, so does :


catch (return) {
        // the page has finished rendering
}

So I have very fine-grained control over the session management :)

What I am not sure about now, is whether the values of widgets on the
Form are bound to the Bean via object references, or if they are
independent copies.

If they are copies, and the Bean does not get touched during the
SendPageAndWait/Validate cycle then all one should need to do
to manage
the HibernateSession is this:

  . . .
   // get the User
   form.load (user);
   session.close();
   form.showForm (formURI);
   session = factory.createSession ();
   form.save (user);
   // save the User
  . . .

If I need to make a 'browser' of 'lazy-initialised'
relationships then
I would be using JXTemplate rather than Woody, with a dynamic model,
and I still have enough control to manage the Session with these
call-back handlers. Excellent!

Thanks for your help.


Cocoon Forms Widgets (aka Woody Widgets) have their own values. If you
do "form.load(myBean)" the values are read out from the bean (--> copies
- no references). If you are finished with data collecting you can write
them back using "form.save(myBean)"

Thanks for the clarification.


I am really impressed with the Cocoon Forms framework!!
And the continuation-lifecycle 'catch' events work well too!!
There is one more event that some people could conceivably want .... but I do not know if it is possible .... "The Continuation has completed".


Many thanks guys!

regards Jeremy



Reply via email to