orbeon / orbeon-forms

Orbeon Forms is an open source web forms solution. It includes an XForms engine, the Form Builder web-based form editor, and the Form Runner runtime.
http://www.orbeon.com/
GNU Lesser General Public License v2.1
514 stars 221 forks source link

xxf:target doesn't work well with get submissions and application/x-www-form-urlencoded #1258

Open evlist opened 11 years ago

evlist commented 11 years ago

Repro:

<?xml version="1.0" encoding="UTF-8"?>
<xh:html xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events"
    xmlns:xxf="http://orbeon.org/oxf/xml/xforms" xmlns:xf="http://www.w3.org/2002/xforms">
    <xh:head>
        <xh:title>xxf:target repro case</xh:title>
        <xf:model>
            <xf:instance>
                <root>
                    <parameter>foo</parameter>
                </root>
            </xf:instance>
            <xf:submission id="submission-same" method="get" serialization="application/x-www-form-urlencoded"
                resource="/whatever" replace="all"/>
            <xf:submission id="submission-new" method="get" serialization="application/x-www-form-urlencoded"
                resource="/whatever" xxf:target="new" replace="all"/>
        </xf:model>
    </xh:head>
    <xh:body>
        <xf:trigger appearance="minimal">
            <xf:label>In a new window (bad)</xf:label>
            <xf:send ev:event="DOMActivate" submission="submission-new"/>
        </xf:trigger>
        <xh:br/>
        <xf:trigger appearance="minimal">
            <xf:label>In the same window (good)</xf:label>
            <xf:send ev:event="DOMActivate" submission="submission-same"/>
        </xf:trigger>
    </xh:body>
</xh:html>

Run this form and see the difference between the two triggers:

avernet commented 11 years ago

Good point. The behavior should be the same in both cases. Without @xxf:target, the server responds with a:

<xxf:load resource="/orbeon/whatever?parameter=foo" show="replace" />

With the @xxf:target, it should just respond with the following (@target is supported by the client):

<xxf:load resource="/orbeon/whatever?parameter=foo" show="replace" target="new" /> 

Assigning to @ebruchez.