Skip to content

Instantly share code, notes, and snippets.

@avernet
Created August 30, 2011 19:27
Show Gist options
  • Save avernet/1181787 to your computer and use it in GitHub Desktop.
Save avernet/1181787 to your computer and use it in GitHub Desktop.
Event retargerting on value changed
2011-08-30 12:24:00,166 INFO ProcessorService - /xforms-server - Received request
2011-08-30 12:24:00,173 DEBUG XFormsServer - ajax request {body: "
<xxforms:event-request xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
<xxforms:uuid>4848B25A-6987-8135-F8D6-B463A6F6CFC7</xxforms:uuid>
<xxforms:sequence>2</xxforms:sequence>
<xxforms:action>
<xxforms:event name="xxforms-value-change-with-focus-change" source-control-id="us-section$xf-513$states-control">fRKNPPoeWLw=</xxforms:event>
</xxforms:action>
</xxforms:event-request>"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - start handling external events and/or uploaded files
2011-08-30 12:24:00,174 DEBUG XFormsServer - executeExternalEvent - start handling external event {target id: "us-section$xf-513$states-control", event name: "xxforms-value-change-with-focus-change"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - start dispatching {name: "xforms-deselect", id: "us-section$xf-513$states-control"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - retargeting {name: "xforms-deselect", original id: "us-section$xf-513$states-control", new id: "us-section$xf-513"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - retargeting {name: "xforms-deselect", original id: "us-section$xf-513$states-control", new id: "us-section$xf-513$states-control"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - retargeting {name: "xforms-deselect", original id: "us-section$xf-513$states-control", new id: "us-section$xf-513"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - retargeting {name: "xforms-deselect", original id: "us-section$xf-513$states-control", new id: "us-section"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - start default action handler
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - end default action handler {time (ms): "0"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - end dispatching {time (ms): "0", name: "xforms-deselect", id: "us-section$xf-513$states-control"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - start dispatching {name: "xforms-select", id: "us-section$xf-513$states-control"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - retargeting {name: "xforms-select", original id: "us-section$xf-513$states-control", new id: "us-section$xf-513"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - retargeting {name: "xforms-select", original id: "us-section$xf-513$states-control", new id: "us-section$xf-513$states-control"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - retargeting {name: "xforms-select", original id: "us-section$xf-513$states-control", new id: "us-section$xf-513"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - retargeting {name: "xforms-select", original id: "us-section$xf-513$states-control", new id: "us-section"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - start default action handler
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - end default action handler {time (ms): "0"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - end dispatching {time (ms): "0", name: "xforms-select", id: "us-section$xf-513$states-control"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - xforms:setvalue - setting instance value {source: "client", value: "CA", changed: "true", instance: "fr-form-instance"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - start dispatching {name: "xxforms-value-changed", id: "fr-form-instance"}
2011-08-30 12:24:00,174 DEBUG XFormsServer - dispatchEvent - start target handler
2011-08-30 12:24:00,175 DEBUG XFormsServer - evaluated model variables {count: "8"}
2011-08-30 12:24:00,175 DEBUG XFormsServer - interpreter - start executing {action name: "action"}
2011-08-30 12:24:00,175 DEBUG XFormsServer - interpreter - not executing {action name: "setvalue", condition type: "if", reason: "condition evaluated to 'false'", condition: "not($parameters/mode = ('test', 'view', 'pdf', 'email'))"}
2011-08-30 12:24:00,175 DEBUG XFormsServer - interpreter - end executing {time (ms): "0", action name: "action"}
2011-08-30 12:24:00,175 DEBUG XFormsServer - dispatchEvent - end target handler {time (ms): "1"}
2011-08-30 12:24:00,175 DEBUG XFormsServer - dispatchEvent - start default action handler
2011-08-30 12:24:00,175 DEBUG XFormsServer - dispatchEvent - end default action handler {time (ms): "0"}
2011-08-30 12:24:00,175 DEBUG XFormsServer - dispatchEvent - end dispatching {time (ms): "1", name: "xxforms-value-changed", id: "fr-form-instance"}
2011-08-30 12:24:00,175 DEBUG XFormsServer - dispatchEvent - start dispatching {name: "xforms-recalculate", id: "fr-form-model"}
2011-08-30 12:24:00,175 DEBUG XFormsServer - dispatchEvent - start default action handler
2011-08-30 12:24:00,175 DEBUG XFormsServer - model - start performing bind recalculate {model id: "fr-form-model"}
2011-08-30 12:24:00,175 DEBUG XFormsServer - evaluated model variables {count: "1"}
2011-08-30 12:24:00,175 DEBUG XFormsServer - evaluated model variables {count: "1"}
2011-08-30 12:24:00,175 DEBUG XFormsServer - model - end performing bind recalculate {time (ms): "0"}
2011-08-30 12:24:00,175 DEBUG XFormsServer - dispatchEvent - end default action handler {time (ms): "0"}
2011-08-30 12:24:00,175 DEBUG XFormsServer - dispatchEvent - end dispatching {time (ms): "0", name: "xforms-recalculate", id: "fr-form-model"}
2011-08-30 12:24:00,175 DEBUG XFormsServer - dispatchEvent - start dispatching {name: "xforms-revalidate", id: "fr-form-model"}
2011-08-30 12:24:00,175 DEBUG XFormsServer - dispatchEvent - start default action handler
2011-08-30 12:24:00,175 DEBUG XFormsServer - validation - start performing revalidate {model id: "fr-form-model"}
2011-08-30 12:24:00,175 DEBUG XFormsServer - model - skipping bind revalidate {model id: "fr-form-model", reason: "no validation binds"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - start dispatching {name: "xxforms-valid", id: "fr-form-instance"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - start default action handler
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end default action handler {time (ms): "0"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end dispatching {time (ms): "0", name: "xxforms-valid", id: "fr-form-instance"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - start dispatching {name: "xxforms-valid", id: "fr-form-metadata"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - start default action handler
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end default action handler {time (ms): "0"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end dispatching {time (ms): "0", name: "xxforms-valid", id: "fr-form-metadata"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - start dispatching {name: "xxforms-valid", id: "fr-form-attachments"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - start default action handler
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end default action handler {time (ms): "0"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end dispatching {time (ms): "0", name: "xxforms-valid", id: "fr-form-attachments"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - start dispatching {name: "xxforms-valid", id: "fr-form-resources"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - start default action handler
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end default action handler {time (ms): "0"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end dispatching {time (ms): "0", name: "xxforms-valid", id: "fr-form-resources"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - start dispatching {name: "xxforms-valid", id: "fr-service-request-instance"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - start default action handler
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end default action handler {time (ms): "0"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end dispatching {time (ms): "0", name: "xxforms-valid", id: "fr-service-request-instance"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - start dispatching {name: "xxforms-valid", id: "fr-service-response-instance"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - start default action handler
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end default action handler {time (ms): "0"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end dispatching {time (ms): "0", name: "xxforms-valid", id: "fr-service-response-instance"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - start dispatching {name: "xxforms-valid", id: "get-states-instance"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - start default action handler
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end default action handler {time (ms): "0"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end dispatching {time (ms): "0", name: "xxforms-valid", id: "get-states-instance"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - start dispatching {name: "xxforms-valid", id: "get-cities-instance"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - start default action handler
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end default action handler {time (ms): "0"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end dispatching {time (ms): "0", name: "xxforms-valid", id: "get-cities-instance"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - validation - end performing revalidate {time (ms): "1"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end default action handler {time (ms): "1"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - dispatchEvent - end dispatching {time (ms): "1", name: "xforms-revalidate", id: "fr-form-model"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - model - start performing refresh {container id: "#document"}
2011-08-30 12:24:00,176 DEBUG XFormsServer - controls - start cloning
2011-08-30 12:24:00,177 DEBUG XFormsServer - controls - end cloning {time (ms): "1"}
2011-08-30 12:24:00,177 DEBUG XFormsServer - controls - start updating bindings
2011-08-30 12:24:00,177 DEBUG XFormsServer - evaluated model variables {count: "3"}
2011-08-30 12:24:00,177 DEBUG XFormsServer - evaluated model variables {count: "3"}
2011-08-30 12:24:00,177 DEBUG XFormsServer - evaluated model variables {count: "1"}
2011-08-30 12:24:00,178 DEBUG XFormsServer - evaluated model variables {count: "3"}
2011-08-30 12:24:00,179 DEBUG XFormsServer - evaluated model variables {count: "8"}
2011-08-30 12:24:00,179 DEBUG XFormsServer - evaluated model variables {count: "1"}
2011-08-30 12:24:00,180 DEBUG XFormsServer - evaluated model variables {count: "8"}
2011-08-30 12:24:00,180 DEBUG XFormsServer - evaluated model variables {count: "8"}
2011-08-30 12:24:00,180 DEBUG XFormsServer - evaluated model variables {count: "8"}
2011-08-30 12:24:00,181 DEBUG XFormsServer - evaluated model variables {count: "3"}
2011-08-30 12:24:00,183 DEBUG XFormsServer - evaluated model variables {count: "8"}
2011-08-30 12:24:00,183 DEBUG XFormsServer - controls - end updating bindings {time (ms): "6", controls visited: "254", repeat iterations visited: "4", bindings evaluated: "231", bindings optimized: "0"}
2011-08-30 12:24:00,183 DEBUG XFormsServer - controls - start evaluating
2011-08-30 12:24:00,184 WARN XFormsServer - xxforms:instance() - instance not found {instance id: "fr-uuid"}
2011-08-30 12:24:00,184 WARN XFormsServer - xxforms:instance() - instance not found {instance id: "fr-save-locally-file-name"}
2011-08-30 12:24:00,184 DEBUG XFormsServer - controls - end evaluating {time (ms): "1"}
2011-08-30 12:24:00,184 DEBUG XFormsServer - controls - start dispatching refresh events
2011-08-30 12:24:00,184 DEBUG XFormsServer - dispatchEvent - start dispatching {name: "xforms-value-changed", id: "us-section$xf-513$states-control"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - dispatchEvent - retargeting {name: "xforms-value-changed", original id: "us-section$xf-513$states-control", new id: "us-section$xf-513"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - dispatchEvent - retargeting {name: "xforms-value-changed", original id: "us-section$xf-513$states-control", new id: "us-section$xf-513$states-control"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - dispatchEvent - retargeting {name: "xforms-value-changed", original id: "us-section$xf-513$states-control", new id: "us-section$xf-513"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - dispatchEvent - retargeting {name: "xforms-value-changed", original id: "us-section$xf-513$states-control", new id: "us-section"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - dispatchEvent - start bubble handler
2011-08-30 12:24:00,185 DEBUG XFormsServer - interpreter - evaluated variables for outer action {count: "2"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - interpreter - start executing {action name: "action"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - interpreter - start executing {action name: "action"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - interpreter - not executing {action name: "setvalue", condition type: "if", reason: "condition evaluated to 'false'", condition: "xxforms:event('xxforms:type') != 'xforms-disabled' and not($visited = $full-id)"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - interpreter - not executing {action name: "setvalue", condition type: "if", reason: "condition evaluated to 'false'", condition: "xxforms:event('xxforms:type') = 'xforms-disabled' and $visited = $full-id"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - xforms:action - evaluated variables within action {count: "5"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - interpreter - end executing {time (ms): "0", action name: "action"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - interpreter - end executing {time (ms): "0", action name: "action"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - dispatchEvent - end bubble handler {time (ms): "0"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - dispatchEvent - start bubble handler
2011-08-30 12:24:00,185 DEBUG XFormsServer - interpreter - evaluated variables for outer action {count: "2"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - interpreter - start executing {action name: "action"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - interpreter - start executing {action name: "action"}
2011-08-30 12:24:00,185 DEBUG XFormsServer - interpreter - not executing {action name: "action", condition type: "if", reason: "missing context"}
2011-08-30 12:24:00,186 DEBUG XFormsServer - interpreter - not executing {action name: "action", condition type: "if", reason: "condition evaluated to 'false'", condition: "xxforms:event('xxforms:type') = 'xforms-invalid' and not(exists($current-error))"}
2011-08-30 12:24:00,186 DEBUG XFormsServer - xforms:action - evaluated variables within action {count: "4"}
2011-08-30 12:24:00,186 DEBUG XFormsServer - interpreter - end executing {time (ms): "1", action name: "action"}
2011-08-30 12:24:00,186 DEBUG XFormsServer - interpreter - end executing {time (ms): "1", action name: "action"}
2011-08-30 12:24:00,186 DEBUG XFormsServer - dispatchEvent - end bubble handler {time (ms): "1"}
2011-08-30 12:24:00,186 DEBUG XFormsServer - dispatchEvent - start default action handler
2011-08-30 12:24:00,186 DEBUG XFormsServer - dispatchEvent - end default action handler {time (ms): "0"}
2011-08-30 12:24:00,186 DEBUG XFormsServer - dispatchEvent - end dispatching {time (ms): "2", name: "xforms-value-changed", id: "us-section$xf-513$states-control"}
2011-08-30 12:24:00,186 DEBUG XFormsServer - controls - end dispatching refresh events {time (ms): "2"}
2011-08-30 12:24:00,186 DEBUG XFormsServer - model - end performing refresh {time (ms): "10"}
2011-08-30 12:24:00,186 DEBUG XFormsServer - executeExternalEvent - end handling external event {time (ms): "12"}
2011-08-30 12:24:00,186 DEBUG XFormsServer - end handling external events and/or uploaded files {time (ms): "12"}
2011-08-30 12:24:00,186 DEBUG XFormsServer - response - start handling regular Ajax response
2011-08-30 12:24:00,186 DEBUG XFormsServer - start computing differences
2011-08-30 12:24:00,187 DEBUG XFormsServer - connection - forwarding cookies {cookie: "JSESSIONID=790DEA1B914125497DA5BB847ED1BF51", requested session id: "790DEA1B914125497DA5BB847ED1BF51"}
2011-08-30 12:24:00,187 DEBUG XFormsServer - connection - forwarding header {name: "user-agent", value: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.865.0 Safari/535.2"}
2011-08-30 12:24:00,200 DEBUG XFormsServer - end computing differences {time (ms): "14"}
2011-08-30 12:24:00,200 DEBUG XFormsServer - response - end handling regular Ajax response {time (ms): "14", ajax response: "
<xxf:event-response xmlns:xxf="http://orbeon.org/oxf/xml/xforms">
<xxf:action>
<xxf:control-values>
<xxf:control id="us-section$xf-513$states-control">fRKNPPoeWLw=</xxf:control>
</xxf:control-values>
</xxf:action>
</xxf:event-response>"}
2011-08-30 12:24:00,202 INFO ProcessorService - /xforms-server - Timing: 36
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:exforms="http://www.exforms.org/exf/1-0"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:saxon="http://saxon.sf.net/"
xmlns:sql="http://orbeon.org/oxf/xml/sql"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<xhtml:head>
<xhtml:title>Calling services</xhtml:title>
<xforms:model id="fr-form-model">
<!-- Main instance -->
<xforms:instance id="fr-form-instance">
<form>
<us>
<states/>
<cities/>
</us>
</form>
</xforms:instance>
<!-- Bindings -->
<xforms:bind id="fr-form-binds" nodeset="instance('fr-form-instance')">
<xforms:bind id="us-bind" nodeset="us" name="us">
<xforms:bind name="states" id="states-bind" ref="states"/>
<xforms:bind name="cities" id="cities-bind" ref="cities"/>
</xforms:bind>
</xforms:bind>
<!-- Metadata -->
<xforms:instance id="fr-form-metadata" xxforms:readonly="true">
<metadata>
<application-name>howto</application-name>
<form-name>service</form-name>
<title xml:lang="en">Calling services</title>
<description xml:lang="en"/>
<author/>
<logo mediatype="" filename="" size=""/>
</metadata>
</xforms:instance>
<!-- Attachments -->
<xforms:instance id="fr-form-attachments">
<attachments>
<css mediatype="text/css" filename="" size=""/>
<pdf mediatype="application/pdf" filename="" size=""/>
</attachments>
</xforms:instance>
<!-- All form resources -->
<!-- Don't make readonly by default in case a service modifies the resources -->
<xforms:instance id="fr-form-resources" xxforms:readonly="false">
<resources>
<resource xml:lang="en">
<states>
<label>States</label>
<hint/>
<help/>
<alert/>
</states>
<cities>
<label>Cities</label>
<hint/>
<help/>
<alert/>
</cities>
<us>
<label>US</label>
<help/>
</us>
</resource>
</resources>
</xforms:instance>
<!-- Utility instances for services -->
<xforms:instance id="fr-service-request-instance" xxforms:exclude-result-prefixes="#all">
<request/>
</xforms:instance>
<xforms:instance id="fr-service-response-instance" xxforms:exclude-result-prefixes="#all">
<response/>
</xforms:instance>
<xforms:instance id="get-states-instance" class="fr-service"
xxforms:exclude-result-prefixes="#all">
<body>&lt;dummy/&gt;</body>
</xforms:instance>
<xforms:submission id="get-states-submission" class="fr-service"
ref="instance('fr-service-request-instance')"
resource="http://localhost:8080/orbeon/xforms-sandbox/service/zip-states"
method="get"
serialization="application/xml"
mediatype="application/xml"
replace="instance"
instance="fr-service-response-instance"/>
<xforms:instance id="get-cities-instance" class="fr-service"
xxforms:exclude-result-prefixes="#all">
<body>&lt;dummy/&gt;</body>
</xforms:instance>
<xforms:submission id="get-cities-submission" class="fr-service"
ref="instance('fr-service-request-instance')"
resource="http://localhost:8080/orbeon/xforms-sandbox/service/zip-cities?state-abbreviation={/us/state}"
method="get"
serialization="application/xml"
mediatype="application/xml"
replace="instance"
instance="fr-service-response-instance"/>
<xforms:action id="states-on-load-binding">
<!-- React to event... on control... -->
<xforms:action ev:event="xforms-ready" ev:observer="fr-form-model">
<!-- Service to call -->
<xforms:send submission="get-states-submission"/>
</xforms:action>
<!-- Request actions -->
<xforms:action ev:event="xforms-submit" ev:observer="get-states-submission">
<!-- Get reference to initial request -->
<xxforms:variable name="request-instance-name" select="'get-states-instance'" as="xs:string"/>
<!-- Copy over to read-write request instance -->
<xforms:insert nodeset="instance('fr-service-request-instance')"
origin="saxon:parse(instance($request-instance-name))"/>
<!--<xforms:insert nodeset="instance('fr-service-request-instance')" origin="instance($request-instance-name)"/>-->
<!-- Set values if needed -->
<xforms:action context="instance('fr-service-request-instance')">
<!-- Setvalue actions will be here -->
</xforms:action>
</xforms:action>
<!-- Response actions -->
<xforms:action ev:event="xforms-submit-done" ev:observer="get-states-submission"
context="instance('fr-service-response-instance')">
<xforms:action class="fr-itemset-action">
<!-- Parameters -->
<xxforms:variable name="control-name" select="'states'" as="xs:string"/>
<xxforms:variable name="response-items" select="/states/state" as="node()*"/>
<!-- Set itemset -->
<xxforms:variable name="control-resources" model="fr-resources-model"
select="$fr-form-resources/*[name() = $control-name]"/>
<xforms:delete nodeset="$control-resources/item"/>
<xforms:action xxforms:iterate="$response-items">
<xxforms:variable name="item-label" select="@name" as="xs:string"/>
<xxforms:variable name="item-value" select="@abbreviation" as="xs:string"/>
<xforms:insert nodeset="$control-resources/*"
origin="xxforms:element('item', (xxforms:element('label', xs:string($item-label)), xxforms:element('value', xs:string($item-value))))"/>
</xforms:action>
</xforms:action>
<!-- Response actions will be here -->
</xforms:action>
</xforms:action>
<xforms:action ev:event="xforms-value-changed" ev:observer="states-control">
<xforms:message level="modal">Value changed</xforms:message>
</xforms:action>
<xforms:action id="cities-on-state-change-binding">
<!-- React to event... on control... -->
<xforms:action ev:event="xforms-value-changed" ev:observer="states-control">
<!-- Service to call -->
<xforms:message>Value changed</xforms:message>
<xforms:send submission="get-cities-submission"/>
</xforms:action>
<!-- Request actions -->
<xforms:action ev:event="xforms-submit" ev:observer="get-cities-submission">
<!-- Get reference to initial request -->
<xxforms:variable name="request-instance-name" select="'get-cities-instance'" as="xs:string"/>
<!-- Copy over to read-write request instance -->
<xforms:insert nodeset="instance('fr-service-request-instance')"
origin="saxon:parse(instance($request-instance-name))"/>
<!--<xforms:insert nodeset="instance('fr-service-request-instance')" origin="instance($request-instance-name)"/>-->
<!-- Set values if needed -->
<xforms:action context="instance('fr-service-request-instance')">
<!-- Setvalue actions will be here -->
</xforms:action>
</xforms:action>
<!-- Response actions -->
<xforms:action ev:event="xforms-submit-done" ev:observer="get-cities-submission"
context="instance('fr-service-response-instance')">
<xforms:action class="fr-itemset-action">
<!-- Parameters -->
<xxforms:variable name="control-name" select="'cities'" as="xs:string"/>
<xxforms:variable name="response-items" select="/cities/city" as="node()*"/>
<!-- Set itemset -->
<xxforms:variable name="control-resources" model="fr-resources-model"
select="$fr-form-resources/*[name() = $control-name]"/>
<xforms:delete nodeset="$control-resources/item"/>
<xforms:action xxforms:iterate="$response-items">
<xxforms:variable name="item-label" select="@name" as="xs:string"/>
<xxforms:variable name="item-value" select="@name" as="xs:string"/>
<xforms:insert nodeset="$control-resources/*"
origin="xxforms:element('item', (xxforms:element('label', xs:string($item-label)), xxforms:element('value', xs:string($item-value))))"/>
</xforms:action>
</xforms:action>
<!-- Response actions will be here -->
</xforms:action>
</xforms:action>
</xforms:model>
</xhtml:head>
<xhtml:body>
<fr:view>
<xforms:label ref="instance('fr-form-metadata')/title"/>
<fr:body>
<fr:section id="us-section" bind="us-bind">
<xforms:label ref="$form-resources/us/label"/>
<xforms:help ref="$form-resources/us/help"/>
<fr:grid columns="2">
<xhtml:tr>
<xhtml:td>
<xforms:message ev:observer="states-control" ev:event="xforms-value-changed" level="modal">Value changed</xforms:message>
<xforms:select1 xmlns:xbl="http://www.w3.org/ns/xbl"
xmlns:fb="http://orbeon.org/oxf/xml/form-builder"
xmlns:pipeline="java:org.orbeon.oxf.processor.pipeline.PipelineFunctionLibrary"
id="states-control"
appearance="full"
bind="states-bind">
<xforms:label ref="$form-resources/states/label"/>
<xforms:hint ref="$form-resources/states/hint"/>
<xforms:help ref="$form-resources/states/help"/>
<xforms:alert ref="$fr-resources/detail/labels/alert"/>
<xforms:itemset nodeset="$form-resources/states/item">
<xforms:label ref="label"/>
<xforms:value ref="value"/>
</xforms:itemset>
</xforms:select1>
</xhtml:td>
<xhtml:td>
<xforms:select1 xmlns:xbl="http://www.w3.org/ns/xbl"
xmlns:fb="http://orbeon.org/oxf/xml/form-builder"
xmlns:pipeline="java:org.orbeon.oxf.processor.pipeline.PipelineFunctionLibrary"
id="cities-control"
appearance="full"
bind="cities-bind">
<xforms:label ref="$form-resources/cities/label"/>
<xforms:hint ref="$form-resources/cities/hint"/>
<xforms:help ref="$form-resources/cities/help"/>
<xforms:alert ref="$fr-resources/detail/labels/alert"/>
<xforms:itemset nodeset="$form-resources/cities/item">
<xforms:label ref="label"/>
<xforms:value ref="value"/>
</xforms:itemset>
</xforms:select1>
</xhtml:td>
</xhtml:tr>
</fr:grid>
</fr:section>
</fr:body>
</fr:view>
</xhtml:body>
</xhtml:html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment