[ic] Values space question

Jon Jensen jon at endpoint.com
Tue May 11 10:42:30 EDT 2004

On Tue, 11 May 2004, Ethan E. Rowe wrote:

> What's the scope of the [values-space] tag and its effects on subsequent 
> calls to [value], [value-extended], or even [perl]$Values->{...}[/perl]?
> The documentation I found indicated that it was just within the scope of 
> the current page (from a  CVS  list posting at 
> http://www.icdevgroup.org/pipermail/interchange-cvs/2004-April/005792.html, 
> "...there is now a [values-space] tag for setting the values space for 
> the lifetime of the current page...").

The values-space tag affects only the current page when it comes to 
reading or changing values. But during the current page run, anything you 
save to the alternate values space will be stored in the session in the 
alternate values space for as long as the session persists (or until some 
other values saved to the alternate values space change things).

To see how it works, store some values in normal values space, then in an
alternate one, then call a page with the [dump] tag and take a look a what
you have in the session.

> However, our admin order entry page specifies a values space of
> "order_entry", and I see in the dumps that this directs all data into
> the values repository hash under the 'order_entry' key.  When an order
> is placed from this page, is the values-space somehow automatically
> passed to the order routes, so our log_transaction calls to [value] or
> $Values->{...} works with the correct data, or must there somehow be
> some explicit setting that gets the routes to work with the appropriate
> space?

A call to [value] is asking for values from the "current" values space. 
Once you set [values-space] it stays for the rest of the page or until you 
explicitly change it. That will affect everything in routes too.

Let me know if this needs more clarification.


More information about the interchange-users mailing list