Skip to content

Instantly share code, notes, and snippets.

@avernet
Created March 9, 2010 03:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avernet/326094 to your computer and use it in GitHub Desktop.
Save avernet/326094 to your computer and use it in GitHub Desktop.
<xhtml:html xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:f="http://orbeon.org/oxf/xml/formatting"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:widget="http://orbeon.org/oxf/xml/widget"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:xbl="http://www.w3.org/ns/xbl"
xmlns:xxbl="http://orbeon.org/oxf/xml/xbl"
xmlns:exf="http://www.exforms.org/exf/1-0"
xmlns:howto="http://www.orbeon.com/howto">
<xhtml:head>
<xhtml:title>Session</xhtml:title>
<xforms:model>
<xforms:instance id="from-session"><dummy/></xforms:instance>
<xforms:insert ev:event="xforms-model-construct-done" nodeset="instance('from-session')"
origin="xxforms:get-request-attribute('session-howto')"/>
<xforms:instance id="ui">
<instance>
<value/>
</instance>
</xforms:instance>
</xforms:model>
</xhtml:head>
<xhtml:body>
<xhtml:div>
<xforms:input ref="instance('ui')/value">
<xforms:label>Value:</xforms:label>
</xforms:input>
<fr:button>
<xforms:label>Store value in session</xforms:label>
<xforms:action ev:event="DOMActivate">
<xforms:insert context="." origin="xxforms:set-request-attribute('session-howto', instance('ui'))"/>
<xforms:toggle case="reload-page"/>
</xforms:action>
</fr:button>
<fr:button>
<xforms:label>Reset content of session</xforms:label>
</fr:button>
</xhtml:div>
<xhtml:div>
<xforms:switch>
<xforms:case/>
<xforms:case id="reload-page">Try reloading this page to see the content of the session.</xforms:case>
</xforms:switch>
</xhtml:div>
</xhtml:body>
</xhtml:html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment