Open Pdf with same request Parameters

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

Open Pdf with same request Parameters

jrabasilio

Hi,

I have a form with request parameters, url is
/fr/Teste/Teste002/edit/24922b9dd5e96440398421290a3ee241eed01082?value=222

When click in pdf button the value is not populate in my controller.

Properties.xml have this configuration :

<property as="xs:string" name="oxf.fr.detail.process.pdf.*.*">
        navigate(
  uri =
        "/fr/{
        xxf:instance('fr-parameters-instance')/app}/{
        xxf:instance('fr-parameters-instance')/form}/pdf/{
        xxf:instance('fr-parameters-instance')/document/string()}"
    )
</property>

Have any tag for get value after document/string() ?
using xxf:get-request-parameter('value') is not solution , my forms have
many parameters, is not pratique.

Ths
João Basílio



--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1606327048829-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Open Pdf with same request Parameters

Alessandro  Vernet
Administrator
Hi João,

If you are passing a request parameter to your form, and would like to have
it available when the PDF is being produced, then you'll need to save that
value in the form data. That means creating a Hidden Field, and having its
initial value set to `xxf:get-request-parameter('value')`. But you're saying
that you would like not to use this function? Where does that constraint
comes from; or maybe I misunderstood your question?

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1606353949150-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Open Pdf with same request Parameters

jrabasilio
Hi Alex,

I dont like use xxf:get-request-parameter('value') function in
properties-template.xml file, in controler is Ok.

In my case, request values is use in edit mode, new form is create by API
(application + "/" + form + "/data/" + uuid + "/data.xml
I send form to user is in edit mode, and in this moment pass request
values,in this case initial value not work, use calculate values.

I think, pdf mode use calculated values to fill this field, but in url not
have request values, and not show.


exemple :
 /Teste002/edit/91486691a97ce5d692b9b4282662a0ec145536cf?teste=teste1
 
Field with name teste with calculated value
xxf:get-request-parameter('value') , filled with "teste1"

When click in "pdf" button to show pdf, redirect to
/Teste002/pdf/91486691a97ce5d692b9b4282662a0ec145536cf

Not have request value, pdf not show field teste filled.

using properties-template.xml if use
<property as="xs:string" name="oxf.fr.detail.process.pdf.*.*">
        navigate(
  uri =
        "/fr/{
        xxf:instance('fr-parameters-instance')/app}/{
        xxf:instance('fr-parameters-instance')/form}/pdf/{
       
xxf:instance('fr-parameters-instance')/document/string()}?teste={xxf:get-request-parameter('teste')}"
    )
</property>

This work fine, but i have many request values, and different name for
request-parameter.
And when add new request, have to remember to add it to the
properties-template, that way it becomes impractical.

one way is using Js
In properties-template.xml
<property as="xs:string" name="oxf.fr.detail.process.pdf.*.*">
        navigate(uri = "javascript:pdfXis()" )
</property>

In js
function pdfXis(){
        var currentURL = window.location.href;
        currentURL = currentURL.replace("/edit/", "/pdf/");
        window.open(currentURL, '_blank');
};

this way work.

Thanks

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1606481458247-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Open Pdf with same request Parameters

Alessandro  Vernet
Administrator
Hi João,

I'm glad using JavaScript to go from the `/edit` to the `/pdf` page passing
all the request parameters works for you, and thank you for the sharing this
technique.

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1606757643405-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet