AVT issues with sourcing an instance

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

AVT issues with sourcing an instance

dthomason
Hi, this is probably a simple issue, but ...

I am evaluating Orbeon forms as an alternative for some significant recodes of XsltForm and betterform pages. In running some tests, I found the AVT code below passes the literal "{...}" rather than the substituted value.

<xf:instance id="ID" resource="http://localhost:8080/exist/apps/testform/testOrbeon.xq?ID={instance('fr-form-instance')/section-1/grid-1/control-4}"/>

The specified instance node contains data. What I am testing is pretty straightforward - a form accepting url parameters and retrieving specific information from various sources based upon the input parameters.

Apologies if there is a simple solution that I am not seeing!
Thanks,
Don
Reply | Threaded
Open this post in threaded view
|

Re: AVT issues with sourcing an instance

Alessandro  Vernet
Administrator
Hi Don,

Indeed AVTs are not supported there. What would the evaluation context be? Typically, it is the root element of the first instance, but what if you are loading the first instance? So , instead, for a case like this you'll need to use a submission, and run it on `xforms-model-construct-done`, which, I know, it a bit verbose. Would that work for your use case?

-Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: AVT issues with sourcing an instance

dthomason
Yes, that works Alex. Thanks. The code that got the concept working was:
            <xf:action event="xforms-model-construct-done">
               <xf:send submission="getRecord"/>
            </xf:action>
            <xf:submission id="getRecord" method="post"
                           resource="http://localhost:8080/exist/apps/testform/testOrbeon.xq?ID={xxf:get-request-parameter('ID')}"
                           ref="instance('record')"
                           replace="instance"
                           instance="record">
               <xf:action event="xforms-submit-error">
                    <xf:message>Submit Error Status: Resource-uri: <xf:output value="event('resource-uri')"/> Response-reason-phrase: <xf:output value="event('response-reason-phrase')"/> Value: <xf:output value="event('response-status-code')"/>
                    </xf:message>
                </xf:action>
            </xf:submission>
Reply | Threaded
Open this post in threaded view
|

Re: AVT issues with sourcing an instance

Alessandro  Vernet
Administrator
Perfect Don, and thank you for the confirmation.

-Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet