Required "asterisk" based on XSD

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

Required "asterisk" based on XSD

jaroslaw.kowalewski66
Is it possible display asterisk next to the label when the field is required based on the XSD definition?

E.g.
I have type

 <xsd:simpleType name="Text">
      <xsd:restriction base="xsd:normalizedString">
         <xsd:minLength value="1"/>
         <xsd:maxLength value="240"/>
         <xsd:whiteSpace value="replace"/>
      </xsd:restriction>
   </xsd:simpleType>

and this means that field is required.

Engine checks if a value is correct based on the XSD but the field is not marked as required.

To have such decorating element I have to add to each field bind with required="true()" and I have hundreds of fields in my form.


Jarek

--
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: Required "asterisk" based on XSD

Alessandro  Vernet
Administrator
Hi Jarek,

Are you saying that you're importing this schema in Form Builder, and having
a reference to from the "Validations and Alerts" tab in "Control Settings"?
If so, no, detecting that the field is required based on the datatype and
marking it as such isn't supported; you'll have to click that "Yes" radio
button in that dialog.

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: Required "asterisk" based on XSD

Jarek
Hi Alex,
no. I'm saying that I just have schema included in the form without having any direct reference. 

I just wonder if it can work that way. E.g. as a form parameter "mark required/build validation based on xsd schema" or something like that.

Of course, I know I can add an attribute required="true()" to each field but it means:
1. I have to define xf:bind for each existing field
2. I don't see any advantage (ok only one - can show to users info that "field is not valid" :) ) in using XSD now. To display any useful information to users I need to define field by field alert and rewrite validation rules to XForms format.


Why I'm asking about that. Let's consider real life scenario:
1. you have existing model - external system xml data format
2. you have existing xsd for such model - 99% of the validation can be done on that level.
3. you want to build an interface using in XForms but you don't want to click 1mln times, because you have 100 different templates to build :)
4. you know XSLT and you can write "simple" transformation that produces code in Form builder format. 

Sounds simple :) 

It's just a feature request :) 
And I would like to say that form builder is a very good and advanced tool! Really good job!

Jarek


W dniu piątek, 4 maja 2018 01:12:22 UTC+2 użytkownik Alessandro Vernet napisał:
Hi Jarek,

Are you saying that you're importing this schema in Form Builder, and having
a reference to from the "Validations and Alerts" tab in "Control Settings"?
If so, no, detecting that the field is required based on the datatype and
marking it as such isn't supported; you'll have to click that "Yes" radio
button in that dialog.

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">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: Required "asterisk" based on XSD

Alessandro  Vernet
Administrator
Hi Jarek,

Got it for the feature request, and I understand how it would makes sense to
"infer" whether a field is required from the schema, to avoid having to
repeat that information with a `xf:bind`.

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