John Goodyear wrote:
> I have a question about the Component model (I think) I want to create a
> system that binds multiple pages together something similar to a wizard.
> The situation is as follows.
> We would like to implement Webware pages that work on there own and do
> some given task however it is desirable to link multiple pages together
> to form a workflow. Ideally each page would not need to know about the
> others in the flow of the wizard. So when Page1 completes flow would
> move onwards to Page2. I guess the design would follow that of a
> PropertySheet which contains one or more PropertyPages. The Container
> sheet would contain any logic needed to tie the Pages together.
> So my question; is Component the right way to do this? if so could
> someone give me a very high level run down of how this would work as the
> examples I can find don't seem to make it clear as to how I would do this.
I don't think Component really has much to help you here. I'd probably
do this with _action_=pageName, and put everything in the same servlet.
You could keep the transient data in a session (OK), or pickle and
sign it and put it in hidden fields (better: back button friendly). I
think there's a recipe for pickling on the wiki somewhere.
Now, putting everything in the same servlet will work better if you
seperate templates from servlets, so that you can have multiple
templates for a single servlet. ZPTKit does this well, and maybe
CheetahKit or KidKit works well too. I believe PSP doesn't do this
well, which is one of the issues with its model. But if you put it in
multiple servlets, you can still use the pickling trick to pass the
complete state of the form around until all fields are filled out. In
that case I'd subclass all the servlets from a single abstract servlet
that implemented the specific form logic.
Ian Bicking / ianb@... / http://blog.ianbicking.org