> any) and the next page.  This 'next page' can follow any number of different
> actions or even no action at all (in the case of a simple navigation).  As
> such, I envisioned taking advantage of run modes to implement a two stage
> decision tree - ie, have each current page set an 'action' mode param value
> and a 'new page' mode param value.  Then, I could use run() to invoke the
> first (again, if any) subroutine, change the mode param, and then invoke the
> second subroutine which would create the output.

Okay, so let me see if I'm understanding this with a short example:
You have three Actions, ACtionA, ActionB, and ActionC.
You have three screens ScreenA, ScreenB, ScreenC.
OVerall, the Screen and the Action have no relation.  (there is some loose
connection, but abstractly, they are unrelated).

If so, it sounds like you have problem with the single Run mode param.
(Probably the most FA of the FAQs)

Would something like this solve it?
(Simple version)
Have your run modes do the appropriate Action, based on the runmode.  Each
run mode returns $self->EvaluateAction() which is a routine that looks at
another param and returns the appropriate screen (or HTML::Template call)

(More complicated but more flexible version)
Create a subclass of CGI::App.  (I'll call it Vaughn::App).  In this
subclass, override run() to act much as it does now, but with first an
action routine, then a screen routine.  You can add functions to act as
the various functions that control run-mode do to control the screen
routine.  Any of your Application modules will be subclasses of this
class.

Be aware that by doing this, you are pretty much surrendering all control
of the screen that is entered.  Just as a user can call any mode by
setting the rm param, they could set the sm (screen mode) param you set up
to give themselves a different screen.  Not necessarily a problem, but
you'll have to figure out how you want to handle it.  If you find yourself
creating all sorts of checking code to verify that screen should happen
with that run mode, you may be better off returning to a single run mode.

Hope this helps.





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to