Tuesday, April 06, 2004

I am trying to use mach-II to dynamically display a page which includes a state map for all of the states we serve. Naturally I wanted this to be dynamic. The suggestion back from the newsgroup was to use the following filter in combination with the following code:


This all worked great, but it is not recommended that you use the above arguments.eventContext.displayView.

Sean coorfield recommended:

> I have read in two places how arguments.eventContext.displayView is
> part of the framework and therefore shouldn't be used by me. Is that
> true?

It is true. EventContext.displayView() should really be
access="package" (very, very few methods in the framework should be
access="public" - 1.0.9 tidied up a lot of this but not all of it).

> If this is bad practice, what would be an alternative approach.

See the thread mentioned above for one option.

Another option is to have a stateView.cfm that does:

cfinclude template="#event.getArg('stateID')#.cfm"

and that's *all* it does - so it's just an indirect view. That's how I
handle the C++ section of my website and also how I wrapped the Movable
Type blog in Mach II.

Regards,
Sean