Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>After taking Alessandro adivces into consideration and searching for other code snippets on <a href="http://wiki.orbeon.com/forms/" rel="nofollow noreferrer">Orbeon wiki</a>, here is the solution that works fine for me :</p> <p>The pipeline receiving a filled form instance on his instance input:</p> <p><strong>piplineWrite.xpl</strong></p> <pre><code>&lt;p:param name="instance" type="input"/&gt; &lt;p:param name="data" type="output"/&gt; &lt;p:processor name="oxf:java"&gt; &lt;p:input name="config"&gt; &lt;config sourcepath="." class="ProcessorWrite"/&gt; &lt;/p:input&gt; &lt;p:input name="input" href="#instance"/&gt; &lt;p:output name="output" ref="data"/&gt; &lt;/p:processor&gt; </code></pre> <p>The PFC catching actions and lauching the corresponding one :</p> <p><strong>page-flow.xml</strong></p> <pre><code>&lt;config xmlns="http://www.orbeon.com/oxf/controller"&gt; &lt;page path-info="/CUSDECCD001B/write" view="Controller/PipelineWrite.xpl"/&gt; &lt;page path-info="/CUSDECCD001B/success" view="View/ViewSuccess.xhtml"/&gt; &lt;epilogue url="oxf:/config/epilogue.xpl"/&gt; &lt;/config&gt; </code></pre> <p>The view Success receiving data output after processing :</p> <p><strong>viewSuccess.xhtml</strong></p> <pre><code>&lt;html ...&gt; &lt;head&gt; &lt;xforms:model&gt; &lt;xforms:instance id="FILE" src="input:instance"/&gt; &lt;/xforms:model&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt; Generation Success !&lt;/p&gt; &lt;div class="toolbar"&gt; Cliquer to download : &lt;xforms:output ref="//file" appearance="xxforms:download"&gt; &lt;xforms:filename ref="@filename"/&gt; &lt;xforms:mediatype ref="@mediatype"/&gt; &lt;xforms:label&gt;Download&lt;/xforms:label&gt; &lt;/xforms:output&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>The view Modify with a "Save" button lauching the whole process :</p> <p><strong>viewModify.xhtml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"&gt; &lt;head&gt; &lt;xforms:model&gt; &lt;xforms:instance id="CUSDECCD001BFile"&gt; &lt;dummy xmlns="" /&gt; &lt;/xforms:instance&gt; &lt;xforms:submission id="save-submission" ref="instance('CUSDECCD001B')" action="/CUSDECCD001B/write" method="post" replace="instance" instance="CUSDECCD001BFile"&gt; &lt;xforms:action ev:event="xforms-submit"&gt; &lt;xforms:send submission="send-submission" /&gt; &lt;/xforms:action&gt; &lt;/xforms:submission&gt; &lt;xforms:submission id="send-submission" ref="instance('CUSDECCD001BFile')" action="/CUSDECCD001B/success" method="post" /&gt; &lt;/xforms:model&gt; &lt;/head&gt; &lt;body&gt; ... &lt;xforms:submit submission="save-submission"&gt; &lt;xforms:label&gt;Save&lt;/xforms:label&gt; &lt;/xforms:submit&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>The main problems in the previous code snippet and advices given were :</p> <ul> <li>the <code>&lt;xforms:instance&gt;</code> must specify a <code>resource=""</code> or at least contains a default content (here <code>&lt;dummy /&gt;</code>),</li> <li>the <code>xforms-submit-done</code> event doesn't seem to work or exist. So, I used an <code>xforms-submit</code> event.</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload