problem with internal xforms:submission

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

problem with internal xforms:submission

Blanc Frédéric
Hi,

I'm must refresh images on an xsl page when an xforms:select1 change of value. I have a look at the examples with flags (selection of a country that trigger a submission updating the value of an xforms:instance and of the xforms:output displaying the images) but in my case it seems that the xpl updating the instance is never called...  Any trick would be welcome.

Here are some piece of my code :

The page-flow (page-flow.xml)
<page id="image" path-info="/is/image" model="get-image-name.xpl" />
<page id="image" path-info="/is/finance" model="model.xpl"  view=" view.xsl"/>

The view (view.xsl)
<xsl:stylesheet ...>
<xsl:template match="/">
<xhtml:html>
<xhtml:head> ...
<xhtml:meta http-equiv="cache-control" content="no-store"/>
<xforms:model xmlns:xforms="http://www.w3.org/2002/xforms">

<xforms:instance id="budget">
...
</xforms:instance> <xforms:instance id="budget2">
<root>
<snoopy>
&lt;img alt="snoopy triste" src="finance/images/file1.jpg"/&gt;
</snoopy>
</root>
</xforms:instance>
<xforms:bind nodeset="instance('budget2')/snoopy" calculate=" ."/>
<!-- Here I want to call the xpl at the /is/image URI to update the value of the instance budget2 and the refresh the image but it doesn't seems to work -->
<xforms:submission ref="instance('budget2')" id="update-image-submission" method="post" action="/is/image" replace="instance"/>
</xforms:model>
</xhtml:head> ...
<xhtml:body>
<xforms:group>
<widget:tabs ref=".">
<widget:tab id="ProjectViewTab">
<widget:label>Project</widget:label>
<xforms:group> <xforms:output ref="instance('budget2')/snoopy" mediatype="text/html"/>
<xforms:select1 ref="instance('budget')/money/currency" appearance="minimale" incremental="true">
<xforms:item>
<xforms:label>CHF</xforms:label>
<xforms:value>CHF</xforms:value>
</xforms:item>
<xforms:item>
<xforms:label>EU</xforms:label>
<xforms:value>EU</xforms:value>
</xforms:item>
<xforms:send submission="update-image-submission" ev:event="xforms-value-changed"/>
</xforms:select1>
</xforms:group>
</widget:tab>
</widget:tabs>
</xforms:group>
</xhtml:body>
</xhtml:html>



The xpl called when the select has changed (get-image-name.xpl)
<p:config xmlns:...>
    <!-- from the flag example -->
    <p:processor name="oxf:xhtml-rewrite">
        <p:input name="rewrite-in"><xhtml:a href="/finance/images/"/></p:input>
        <p:output name="rewrite-out" id="link-to-image"/>
    </p:processor>

    <p:processor name="oxf:xslt">
        <p:input name="data">
                <br/>
                </p:input>
                <p:input name="link-to-image" href="#link-to-image"/>
        <p:input name="config">
            <xsl:stylesheet version="2.0">
                <xsl:template match="/">
                    <root>
                        <snoopy>

                  &nb sp;         <xsl:text>&lt;img src="</xsl:text>
                            <xsl:value-of select="doc('input:link-to-image')/xhtml:a/@href"/>
                            <xsl:text>file.jpg"/></xsl:text>
                        & lt;/snoopy>
                    </root>
                </xsl:template>
            </xsl:stylesheet>
        </p:input>
        <p:output name="data" id="xml-response"/>
    </p:processor>

Why the instance isn't updated? I'v try to write it textually but it's the same... I don't see my error


-----------------------------------------------------
Romandie Annonces : http://annonces.romandie.com
Petites annonces 100% gratuites entre romands
-----------------------------------------------------




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws