problem with internal xforms:submission (2)

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with internal xforms:submission (2)

f.blanc
Sorry for posting twice but the previous message is fancy layouted and illegible...

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="">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=""
        <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=""
        <p:input name="config">
            <xsl:stylesheet version="2.0">
                <xsl:template match="/">
                    <root>
                        <snoopy>
                  &nb sp;         <xsl:text>&lt;img src=""
                            <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


--
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
Reply | Threaded
Open this post in threaded view
|

Re: problem with internal xforms:submission (2)

f.blanc
Well in my last post the action attribute was empty. In my file I have a value but a wrong one. After correction, the instance is updated correctly.

<xforms:submission ref="instance('budget2')" id="update-image-submission" method="post" action="/is/image" replace="instance"/>

But now I have another problem : the instance bound to the <xforms-output meidatype="text/html"> receive always the same value : the tag <img src=".../file.jpg"/> and when the image change on the server side, it is not updated in the xsl view.

In my xsl page, I force to not use the cache
<xhtml:meta http-equiv="cache-control" content="no-store" />
but I imagin that the ops caches are my problem. How can I disable them?

Than you



--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: problem with internal xforms:submission (2)

Erik Bruchez
Administrator
Frederic,

I doubt very much that the Orbeon Forms cache has anything to do with
this, especially since you use a submission with replace="instance",
which doesn't reload the page in the first place.

One thing to do is to see if your instance was really updated after
submission. For that purpose, you can enable XForms logging, which logs
instances after each Ajax request, or use the Instance Inspector. If you
do any of this, do you see the instances update with the correct value
for your image?

Can you also check that /is/image actually returns the new image name?

-Erik

[hidden email] wrote:

> Well in my last post the action attribute was empty. In my file I have a value but a wrong one. After correction, the instance is updated correctly.
>
> <xforms:submission ref="instance('budget2')" id="update-image-submission" method="post" action="/is/image" replace="instance"/>
>
> But now I have another problem : the instance bound to the <xforms-output meidatype="text/html"> receive always the same value : the tag <img src=".../file.jpg"/> and when the image change on the server side, it is not updated in the xsl view.
>
> In my xsl page, I force to not use the cache
> <xhtml:meta http-equiv="cache-control" content="no-store" />
> but I imagin that the ops caches are my problem. How can I disable them?
>
> Than you
--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: problem with internal xforms:submission (2)

f.blanc
In reply to this post by f.blanc
Well... you were right. The problem is that my instance is not updated by the submission. I have verify the output of the xpl called for the submission at the uri /is/image/ and the output is correct. So I imagine that the submission is not executed...


what can be the reason that a submission action is not executed?

I receive randomly an error (perhaps might it be be the reason?): XForms error: Control is no longer bound to a node. Cannot set external value.


When the error doesn't raise, the instance is correctly updated.  Do you know  what's going wrong ?

view.xsl
<xforms:instance id="budget-main">
    <parameters xmlns="">
        <finance>
            <currency>CHF</currency>
            <rate>1.5</rate>
        </finance>
        ...
</xforms:instance>
...
<xforms:submission ref="instance('budget-main')" id="update-image-submission" method="post" action="/is/image" replace="instance" validate="false"/>
...
<xforms:select1 ref="instance('budget-main')/finance/currency" appearance="minimale">
    <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>

ps.
I have uncomment the lines corresponding to XFormsServer and PageFlowControllerProcessor in config/log4j.xml, restart tomcat, but no ops.log is generated. How can I see the log file?
When I try to include the instance inspector by adding <widget:xforms-instance-inspector xmlns:widget="http://orbeon.org/oxf/xml/widget"/>, nothing happens. Have I forgotten to do something to allow it to display?




--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: problem with internal xforms:submission (2)

Erik Bruchez
Administrator
Frédéric,

 > what can be the reason that a submission action is not executed?

Several reasons: an invalid instance, for example, or one containing
required-but-emtpy fields. But you use validate="false", so you should
be fine.

 > I receive randomly an error (perhaps might it be be the reason?):
 > XForms error: Control is no longer bound to a node. Cannot set
 > external value.

This is not good. I haven't seen this error in a long time. Do you use
a recent build?

 > I have uncomment the lines corresponding to XFormsServer and
 > PageFlowControllerProcessor in config/log4j.xml, restart tomcat, but
 > no ops.log is generated. How can I see the log file?

It depends on what appender you have enabled in log4j.xml. If you have
the ConsoleAppender enabled, the output should go to your Tomcat
console. If you have SingleFileAppender or RollingFileAppender
enabled, the output should go to a file, configured in the Appender
sections above in the file.

 > When I try to include the instance inspector by adding
 > <widget:xforms-instance-inspector
 > xmlns:widget="http://orbeon.org/oxf/xml/widget"/>, nothing happens. Have
 > I forgotten to do something to allow it to display?

You may be using a build of Orbeon Forms that doesn't yet include the
Instance Inspector?

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/




--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: problem with internal xforms:submission (2)

f.blanc
Eric,

After installing the nightly built to have the possibility to log submissions, I've noticed that the name of the xpl's input was "params" and not "instance" -_-' (that was the reason why the xpl file was never called...) and now it works! ^^

Except the fact that with the version we use (ops 3.5 milestone 1) I receive sometimes the message "control not bound, can't set value..."

Thank you for your help!



--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: problem with internal xforms:submission (2)

Alessandro Vernet
Administrator
Hi Frédéric,

Have you figured out since you last posted this message why you were
getting this message "control not bound, can't set value..."? Is this
something that you can reproduce now?

Alex

On 2/8/07, [hidden email] <[hidden email]> wrote:

> Eric,
>
> After installing the nightly built to have the possibility to log submissions, I've noticed that the name of the xpl's input was "params" and not "instance" -_-' (that was the reason why the xpl file was never called...) and now it works! ^^
>
> Except the fact that with the version we use (ops 3.5 milestone 1) I receive sometimes the message "control not bound, can't set value..."
>
> Thank you for your help!
>
>
>
> --
> 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
>
>

--
Orbeon Forms - Web 2.0 Forms for the Enterprise
http://www.orbeon.com/



--
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