Orbeon Form Builder validation constraint on repeating element - validation

I am using Orbeon Form Builder and have a form with a repeat section, containing a field named address as well as some other fields.
There can be a minimum of 4 repeats and a maximum of 6.
Is there a way to add a constraint on the repeating address field to make it mandatory unless it is the last item?

Say your repeat grid name is address (this is the name of the repeat grid, not the field). Then on the field you can use the following constraint:
empty(../following-sibling::address) or . != ''
Essentially, you're saying that this field is always valid if there are no following address iterations (which means we're on the last line), and other its value must be non-empty.

Related

how to specify custom validation for user details like telephone number, last name etc. in Oracle Identity Manager?

I had logged in as xelsysadm in oracle identity manager and created different users, then i tried to create custom validation for fields such as telephone number and last name, but i don't know where to specify the regular expression and in what way the regular expression is to be specified. I had activated the sandbox,customized it and from the options i chose structure(located at the top left corner) and selected the telephone number column which is to be custom validated, then chose the corresponding tag for the telephone number column from right-side, then various display options were displayed such as VALUE, PARTIAL TRIGGERS etc, but i don't know where to specify the regular expression for validation and in what way it is to be mentioned.
I specified the below tag in VALUE field, but the result was not the expected.
af:validateRegExp pattern="/^+(\d+\s?)+$/"
Where to specify and how to specify the regular expression?
I specified af:validateRegExp pattern="/^+(\d+\s?)+$/" in the value field but it is not working as expected.
af:validateRegExp pattern="/^+(\d+\s?)+$/"
I expect the result to be like, when in future on creating a new user there should be strict validation for telephone number field like there must be a '+' sign in the beginning followed by numerical digits.

Orbeon form builder - limit repeating element based on field value

I am using Orbeon Form Builder and have a form with a repeat section. The no. of repeats has been set to 3 however I want to vary this depending on the value set in another field. Do you know if this is possible?
The field and repeating element are in different sections on the form.
Thanks
Paul
I created a working example. The idea:
place an event handler reacting to a change of value of the count field
depending on whether the value is larger or smaller than the current number of iterations, remove or insert new iterations
this relies on the xxf:bind() function, and on knowledge of the grid repeat template
This said, as is I don't think it's a good user interface, as it can delete data upon tabbing out of the count field.

Google spreadsheet validation if statement

I've used validation to create a drop down list of things that will require different values. So in the next column I want to create a formula that checks if anything has been selected in the list (otherwise show nothing e.g ""). Then if a certain item has been selected, multiply it by a certain value, say 2 and then display the total.
=if(isblank(A1);"";A1*2) will return blank if A1 is blank and twice the value in A1 otherwise. If by a certain item you mean only one of the valid items is to be doubled, then please instead try =if(A1=x;A1*2;"") where x is the 'certain item' value.

Queries with NSValueTransformer

1.In my application there is a requirement to display certain value (among the 3 different values) in each row of the table column,the value to be displayed in each row can be decided by checking the values of two different model key paths.
This i tried to implement using bindings,where i used "Display pattern Value1 with one key path and custom value transformer class" and "Display pattern Value2 with other key path and same value transformer".But i am not getting desired output value from the transformer class.Can anyone please help me in resolving this issue.
2.In the other application there is a table view with 3 columns,where the first column displays the complete word,second column displays the prefix of that word and the third column displays the suffix of that word.
I implemented this requirement using bindings and two custom value transformer classes.One for getting the prefix of the word(prefixExtractor) and the other for getting the suffix of the word(suffixExtractor).Can anyone suggest me how can i implement this requirement using only one custom value transformer class so that it optimizes my code.
Thanks in advance.

Dojo Composite/Group validation

Given 2 text fields that (e.g. House Number, and House Name) on a form, and in order to be valid the user must enter a number or name in the appropriate field before the 'group' of 2 fields is considered valid.
A user could enter just a house number, or a house name, but entering a value in either field marks both of them valid.
Is there a way to do this in Dijit/Dojo? The idea of a composite or group of validation elements would be perfect.
Thanks,
dijit.form.Form has an isValid function that by default makes sure all of its children dijit.form widgets are valid. You can use stock dijit.form.ValidationTextBox widgets in combination with attributes like regexp and required, or descendants like NumberTextBox to specify validation rules.

Resources