Problem with xforms:submission to a SQL processor with replace="instance"

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

Problem with xforms:submission to a SQL processor with replace="instance"

Roman_

I have been looking through the forums for several hours now, but could not
find somebody with the exact same problem or where the proposed solution
worked in my case.

I am trying to populate a select1 using an SQL processor, which gets the
values from a database.

The SQL processor seems to work (I can see the query being performed and
the XML being built in the debug output), but the instance I want to be
replaced is not, meaning I do not get the instance with the result of the
SQL processor.

First I tried using an event which fires on xforms-ready and the event
fires, but does not replace the instance. Then I put the processor in the
model of the view and got the result with <xforms:instance
src="input:data"> and this actually works. But I still need to get the
submission to work, as I want to use this further for other operations.

I attached the relevant sources for the pageflow, the processor and the
view.

Any help would be appreciated.

Best regards,

Roman


-- page-flow.xml --

    <page path-info="/xforms-rs3/" view="view.xhtml"
model="service-countries-get.xpl"/>

    <!-- Services -->
    <page path-info="/xforms-rs3/countries-get"
model="service-countries-get.xpl"/>

-- view.xhtml --

            <xforms:instance id="countries_in">
                <dummy xmlns=""/>
            </xforms:instance>

            <xforms:instance id="countries">
                <dummy xmlns=""/>
            </xforms:instance>
           
            <xforms:instance id="countries_2" src="input:data"/>

            <xforms:submission id="countries-get-submission"
ref="instance('countries_in')" replace="instance" instance="countries"
method="post" action="/xforms-rs3/countries-get"/>
            <xforms:send submission="countries-get-submission"
ev:event="xforms-ready"/>

...

        <xforms:trigger>
            <xforms:label>Refresh</xforms:label>
            <xforms:action ev:event="DOMActivate">
                <xforms:send submission="countries-get-submission"/>
            </xforms:action>
        </xforms:trigger>

-- service-countries-get.xpl --

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
        xmlns:sql="http://orbeon.org/oxf/xml/sql"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:oxf="http://www.orbeon.com/oxf/processors"
        xmlns:xi="http://www.w3.org/2001/XInclude">

    <p:param type="input" name="instance"/>
    <p:param type="output" name="data"/>

    <p:processor name="oxf:sql">
        <p:input name="data" href="#instance"/>
        <p:input name="config">
            <sql:config>
                <countries xmlns="">
                    <sql:connection>
                        <sql:datasource>db</sql:datasource>
                        <sql:execute>
                            <sql:query>
                                SELECT id, name FROM countries ORDER BY
name
                            </sql:query>
                            <sql:result-set>
                                <sql:row-iterator>
                                    <country>
                                        <id>
                                            <sql:get-column-value
type="xs:int" column="id"/>
                                        </id>
                                        <name>
                                            <sql:get-column-value
type="xs:string" column="name"/>
                                        </name>
                                    </country>
                                </sql:row-iterator>
                            </sql:result-set>
                        </sql:execute>
                    </sql:connection>
                </countries>
            </sql:config>
        </p:input>
        <p:output name="data" ref="data"/>
    </p:processor>

</p:config>





--
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
OW2 mailing lists service home page: http://www.ow2.org/wws