Set property with regex to a form control via properties.

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

Set property with regex to a form control via properties.

inigo10rodri
Hi,

Instead of using regular expressions for the validations of each form
control, the client prefer to do it via properties.
So is there any other solution to be able to use those regular expressions
in the properties, instead of each form control?

Thanks,
Iñigo.

--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Set property with regex to a form control via properties.

Erik Bruchez
Administrator
Iñigo,

What do you mean by using those regular expressions in the properties? Do
you have an example?

-Erik

--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Set property with regex to a form control via properties.

inigo10rodri
Hi Erik,

What I want to say is if there is any way to validate with regex by the
input type or something similar.

It could be something like this?:

<property as="xs:integer" name="oxf.fr.format.input.number" value="true"
validation="matches(.,'^(\d{9}|\d{3}\s\d{2}\s\d{2}\s\d{2})"/>?

It would be possible or we can only do the validation by adding a formula in
the control options?

Hope you can answer soon, thanks.
Iñigo.

--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Set property with regex to a form control via properties.

Alessandro  Vernet
Administrator
Hi Iñigo,

I think you can do what you are looking for by creating an XML Schema that defines a simple type for the format you expect. Next, in Form Builder, form authors can attach the schema you created to the form, and the type you created will show up in the dropdown so they can just select it without having to enter an XPath expression with a regular expression. For more on this see the page linked below. You'll let me know if this works for you.


A;ex

On Thu, Aug 9, 2018 at 8:31 PM inigo10rodri <[hidden email]> wrote:
Hi Erik,

What I want to say is if there is any way to validate with regex by the
input type or something similar.

It could be something like this?:

<property as="xs:integer"       name="oxf.fr.format.input.number" value="true"
validation="matches(.,'^(\d{9}|\d{3}\s\d{2}\s\d{2}\s\d{2})"/>?

It would be possible or we can only do the validation by adding a formula in
the control options?

Hope you can answer soon, thanks.
Iñigo.

--
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 post to this group, send email to [hidden email].

--
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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Set property with regex to a form control via properties.

inigo10rodri
Hi Alessandro,

It works fine, I added a new XML schema to do the validations.
But it would be possible to add more than one schema per form?
 
Thank you,
 Iñigo.

--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Set property with regex to a form control via properties.

Alessandro  Vernet
Administrator
Hi Iñigo,

I'm glad attaching a schema with the simple type using a regex is working
for you! At this point you can only have one schema per form, but you can
certainly have multiple simple types defined in the same schema. Typically,
customers would create just a schema that contains all the types they need.

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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Set property with regex to a form control via properties.

inigo10rodri
Hi Alessandro,

I was thinking that it could be the way to do it, so I'll do it that way.

Thank you very much.

Iñigo.

--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Set property with regex to a form control via properties.

Alessandro  Vernet
Administrator
Excellent Iñigo, and you'll just let us know if somehow adding multiple
simple types in a single XSD is creating any trouble for you.

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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Set property with regex to a form control via properties.

inigo10rodri
Yes, in case I have a problem I will let you know.

Thanks for your help, it helped me to solve the problem I had.
Iñigo

--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Set property with regex to a form control via properties.

inigo10rodri
In reply to this post by Alessandro Vernet
Hello Alessandro,

We have a template with different sections and we are having problems making
a section that has two radio buttons. Depending on the selected show the
next section or not.

It would be possible to define a template that contains several sections and
in each section the validations would be included through an XML schema.

Then, the form will load the sections that must be loaded according to the
options selected in the form.
Each loaded section would already have the necessary validations and in this
way it would not be necessary to define several templates for the same form.

In short, it would be a single template that define the possible sections
with their validations.

Thank you very much,
Iñigo.

--
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 post to this group, send email to [hidden email].