Orbeon forms convert number from textfield into words? - orbeon

i am creating orbeon form, so i write a script that can convert number into words,now is it possible to pass the parameter url in orbeon to read a text field and convert the number in to word in another textfield or populate another textfield from the url?

I'm not sure what you need. If you need get URL parameter you can use xxf:get-request-parameter() (https://doc.orbeon.com/xforms/xpath/extension-functions/extension-http#xxf-get-request-parameter). For example set this funciton as calculated value for some Text Field, publish form and test it in Runner.
If it not correct answer, please write more information about you problem.

Related

How to define dynamically the label of a 'text field' control in Orbeon Forms?

I wish to ask you if it is possible to define dynamically the label of a 'text field' control when a form is loaded. Actually, I need to pass the label value through a URL parameter and use this value to define the label. Is that possible? I've made a research for a similar case but I cannot find a way to get the value of a url parameter and set it as a control's label before the form is displayed in the user.
Regards,
George
In the Control Settings for your control, in the Label tab, do something as follows. Here I'm getting the value of the foo request parameter, but you'll most likely want to use a more meaningful name.
That's it, really: with this, when you load your form, say with the URL http://localhost:8080/orbeon/fr/a/a/new?foo=bar, the control will get "bar" as its label. Also see Template syntax.

Zapier form dynamic inputFields manipulation

I'd like to manipulate the input fields of a trigger form dynamically:
I have a trigger 'hidden' with a combo-box in a form
Each time I update the combo, it should add one or more combo-boxes in the same form depending on the value
I couldn't find any way to access the operation.inputFields somewhere for doing an update on this list dynamically, whether via the bundle or else...
Here is the small example: https://github.com/nuxeo-sandbox/nuxeo-zapier/blob/spikes-NXP-26085-zapier/nuxeo-zapier-app/triggers/project.js#L8-L16
Thank you for your help!
Vlad
David here, from the Zapier Platform team.
It sounds like you're looking for Custom Fields: https://github.com/zapier/zapier-platform-cli#customdynamic-fields
In addition to a static list of input fields, you can provide a function that will run and provide a dynamic set of fields. It's how we get inputs for each column in a google sheet:
Is that what you're asking? Modifying the inputFields array at runtime probably doesn't do what you want.

Time format for PDF template in Orbeon 4.10

Im using orbeon 4.10 to collect data and fill back a PDF from a template. I would like to choose how the time is displayed on the pdf. I have seen the oxf.xforms.format.input.time and oxf.xforms.format.output.time properties, but they seem to only control the form itself.
I have also seen this, but it seems to relate to the date format.
What value do I need to change in my properties?
Thanks
UPDATE: I don't think my solution below actually works. I think this might have worked at some point but might not work anymore. We do have an RFE for this.
You can use the following property:
<property
as="xs:string"
name="oxf.fr.resource.$app.$form.$lang.print.formats.time"
value="[H01]:[m01]:[s01]]"/>
where:
$app is the app name
$form is the form name
$lang is the language which applies
You can use wildcards (*) for all of those.
As a workaround i used a Hidden field to format my time correctly for the pdf.
Here is the formating code :format-time($controlname, '[H01]:[m01]') that i used in the calculated value
Here is the visibility code : $fr-mode = 'email' for the pdf generated from email or $fr-mode = 'pdf' for pdf button.

Formatting Orbeon Date input fields

I am trying to format an input field of the type xs:date in Orbeon.
I have tried using the xxf:format attribute, but the datepicker can not understand the date when it has been modified.
The idea now was to change the javascript of Orbeon to use the xxf:unformat attribute to interpret the date and transform it back to ISO format.
I've tried changing the data.js but for some reason none of the changes can be seen.
Am I changing the wrong file?
Edit
I figured out that the xforms.js has a function 'getCurrentValue' which is being as the changes I do there are visible. Now I just need to figure out who is the one that's calling the function.
Edit:
It is the Calendar who requests the value of the input when the user clicks on the symbol. This all happens at the client side, and the generated HTML does not have the format/unformat attributes. However I want to use their value. Can I make a request to Orbeon to get it? How?
In case you're using an xf:input bound to a node of type xs:date, you can control the formatting of the date field with the oxf.xforms.format.input.date property. A few formats are supported, and if you want to add more, the best would be to follow the pattern currently used for the currently supported formats.
E.g.
[M]/[D]/[Y]
[Y]-[M01]-[D01]

Orbeon form builder: Using date fields with initial value "current-date()"

I am using date fields in Orbeon form builder that should be prefilled with the current date (see http://i42.tinypic.com/erdjrb.jpg). When choosing a date by hand in the form, the date format in resulting XML model is set to "2011-07-12". But when not changing the default value of current-date(), then I get "2011-07-12+02:00". Does anybody know why the date format is different when I prefill it with current-date()?
Thank you!
The XPath function fn:current-date() by definition returns the date together with explicit time zone information. I assume orbeon just passes the function call to the XPath engine (Saxon i think). A quick workaround would be to format the result of current-date() using format-date(), for example:
format-date(current-date(), '[Y]-[M01]-[D01]')
Since i don't use Form Builder, i can't tell in detail, but i assume setting the config options how to format xforms:input controls regarding date and time values applies for form builder, too.

Resources