Need help with setting form element value through url parameter

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

Need help with setting form element value through url parameter

abiketov
Hi,

I saw that this topic was discussed number of times on this forum but I still can't make it working.
I have:
..
            <xf:instance id="fr-form-instance" xxf:exclude-result-prefixes="#all">
                <form>
                    <user>
                        <first-name/>
                        <last-name/>
                    </user>
                </form>
            </xf:instance>
..
 <xf:setvalue ev:event="xforms-model-construct-done" ref="first-name"
                         value="xxf:get-request-parameter('_name')"/>

That set value call doesn't work.
I try it in FormRunner like this:
http://localhost:8080/orbeon/fr/abc/simple/edit/f6251969144cc28e79e0c8cbda51672cbaa95771?_name=11111111

Thanks,

Andrei
Reply | Threaded
Open this post in threaded view
|

Re: Need help with setting form element value through url parameter

abiketov
I got this working after making this change:
<xf:action ev:event="xforms-ready">
                <xf:setvalue ref="/form/user/first-name" value="xxf:get-request-parameter('value')"/>
</xf:action> 
Reply | Threaded
Open this post in threaded view
|

Re: Need help with setting form element value through url parameter

Alessandro  Vernet
Administrator
Hi Andrei,

Right, you have to use the full path to the element that holds the value for that control. I am glad you found that out.

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