Extract parameter from URL of the form

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

Extract parameter from URL of the form

karthik Jayaraman
First i create a form using form builder and i publish it. I copy the url since it ll present in some other place (say a plain html page)

e.g http://localhost:9090/orbeon/fr/URLTest/URLTestForm/new/ is the url of my form

now i ll pass some query string through url like

http://localhost:9090/orbeon/fr/URLTest/URLTestForm/new/?value=xyz

When my form is getting initialized i have to get the value of attribute "value" and store it in a textbox in my form .

Please anyone provide a step-by-step methodology of doin it !!
Reply | Threaded
Open this post in threaded view
|

Re: Extract parameter from URL of the form

Ethan Gruber
Put this in your model:

<xforms:action ev:event="xforms-model-construct-done">
  <xforms:setvalue ref="instance('instance')/node" value="xxforms:get-request-parameter('value')"/>
</xforms:action>

You are getting the "value" parameter from the URL and inserting it to the ref that you specify.

Ethan

On Mon, Mar 29, 2010 at 7:37 AM, karthik Jayraman <[hidden email]> wrote:

First i create a form using form builder and i publish it. I copy the url
since it ll present in some other place (say a plain html page)

e.g http://localhost:9090/orbeon/fr/URLTest/URLTestForm/new/ is the url of
my form

now i ll pass some query string through url like

http://localhost:9090/orbeon/fr/URLTest/URLTestForm/new/?value=xyz

When my form is getting initialized i have to get the value of attribute
"value" and store it in a textbox in my form .

Please anyone provide a step-by-step methodology of doin it !!
--
View this message in context: http://n4.nabble.com/Extract-parameter-from-URL-of-the-form-tp1695004p1695004.html
Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.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
OW2 mailing lists service home page: http://www.ow2.org/wws




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

Re: Extract parameter from URL of the form

karthik Jayaraman
Until now i donot have any model specified in page-flow.xml (Its the default one untouched). So i have to specify my model name in tht file and in the model i have to include those lines right ??
Reply | Threaded
Open this post in threaded view
|

Re: Extract parameter from URL of the form

stessy
Ethan is not talking about the page-flow.xml

Insert the portion of code he gave you in your xform model

<xforms:model>
</xforms:model> 

Stessy
Reply | Threaded
Open this post in threaded view
|

Re: Extract parameter from URL of the form

karthik Jayaraman
K thanks people . Got it !!! :)) Thanks for the help