[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Run-Modes and events question


> If I understand the docs, the run-mode corresponds to the "current state"
> or form being displayed in your application  (As opposed to the the "next
> state" or state that you get to from a transition).

If you are saying the run_mode refers to the state the program is
currently trying to display, then yes.  (i.e. Calling Foo.pl with
rm=View results in the View page)

> What I don't see illustrated in the examples in the events that cause a
> transition from one state(run-mode) to another.

At the most basic level, the event is the user requesting that same
script with a different run mode.  The code does not enforce an order to
progression through states.  (though your code can attempt to).  There
is casual enforcement through the options you display, but aknowing user
can always hit Foo.pl?rm=Bar to jump directly to that state without
passing through others unless YOUR code prevents it.

> The state or run-mode is encoded in a hidden form field (typically "rm"),
> but what about the events.

The run mode encoded should be the destination run modes, not the run
mode that generated that page.  

> In the examples I saw there seemed to be only one possible event generated
> per form.  This is fine for an example, but most forms have a number of
> events that could be generated (hyperlinks, form buttons, image buttons, etc.)

Each of those events would call the script and tell it(via GET/POST of
the rm attribute) what run_mode it wanted to enter.

> What are some of the way events are modeled within a CGI::Application program,
> with the emphasis on having one out of many possible events being generated
> from the same run-mode?

Here's a simple one:  State "A" can lead you to States "B" or "C".
Either of those can lead you to "A" or "D".  "D" will only lead you to
"A".

So the app module runmode "A" would return an HTML page with links to
Foo.pl?rm=B and Foo.pl?rm=C.  The user would choose to follow one of
those links.

Runmodes B and C would each print links to Foo.pl?rm=A and Foo.pl?rm=D

Runmode D would only have Foo.pl?rm=A

Note, however, that a user could type "Foo.pl?rm=C" in their browser and
go straight to that runmode.  (Or follow a bookmark, or a search engine
link, or whatever).

I think you might be confusing _when_ the runmode takes effect.  (I say
"Give me 'A', and runmode 'A' returns a page with links that will
trigger other runmodes.  The runmodes in those links are NOT 'A'.)

Or, perhaps I've totally misunderstood your question.



-- 
SwiftOne
suppressed

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.