My Badges
ThePort
Employee
Wunderkind
1293 Points
My Friends


My Groups
visit  profile
visit  profile


My Features
visit  profile
visit  profile
visit  profile
visit  profile


My APIs
visit  profile
visit  profile



Twitter
(TJ Muehleman)
Admin since '09
TJ Muehleman - VP, Technology
status: Working on revamping the community a bit more. More documentation coming soon...
Subscribe to this blog ThePortLabs Blog Add New Entry
Welcome to ThePort's Engineering Blog
Trigger vs. Process Server Module
Posted by: TJ Muehleman on May 24, 2010 at 4:54PM EST
Just a quick helpful hint on something I've been asked a few times of late. When executing a server module in our XSLT template system, you can do it one of two ways:

ProcessServerModule or TriggerServerModule

The difference between the two is subtle, especially if you're looking at it from the user's perspective. But under the hood, the different is definitely noteworthy.

ProcessServerModule
You want to use ProcessServerModule in most cases. This logic does the processing at the server and sends the output down as rendered HTML to the client. If you view source, you'll see the HTML of the module

TriggerServerModule
The TriggerServerModule is also rendered on the server, however, instead of sending rendered HTML down to the browser, it sends an AJAX call that can be triggered by some event (onClick, onBlur, etc). So if you do a view source, you'd only see the AJAX call and not the rendered output. This is a handy method to use if you're loading modules hidden behind tabs or other event driven code.

| Send This | Categories:
(1) Comments
Posted by: Anonymous on May 25, 2010 6:07AM EST
If the parent Div that holds your TriggerServerModule is initially hidden, the ajax will automatically be invoked when that dir becomes visible.
For example:

TriggerServerModule (something)

The processing work for this transform will be off-loaded from the page processing until the ajax call is made which gets "triggered" when "foo" becomes made visible.
This allows a page filled with tabs or hidden areas to process much faster and only process later (via ajax) on a need by need basis.

Loading...