Passing Smartsite context to the XForms engine

PRELIMINARY INFORMATION - SUBJECT TO CHANGE

Release 2.1 - ...

The XForms engine is fairly isolated from the Smartsite Runtime, with XML as the primary interoperability layer. This can cause problems when you have state in the Smartsite page prior to running a form, and wish to make it available when submits are done from the XForms Engine, or when the XForms Engine loads resources (such as instance XML) in the site.

Of course, session state is a possibility, but sessions are not always desirable.

Luckily, the Smartsite XForms integration provides a mechanism for passing data to any outgoing requests during an XForms session, using the xform.request.setcookie viper.

Smartsite SXML CopyCode image Copy Code
xform.request.setcookie(string name, object value)

In your XML items, or in items submitted to, you can then simply call the existing request.getcookie() viper method.