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