Login  Register

Re: RE: .xsd schema and forms

Posted by Baschir Jaghoori on Nov 30, 2009; 8:58am
URL: https://discuss.orbeon.com/Date-formatting-in-Orbeon-3-7-1-tp278175p931105.html

Hi Steven,

I've had the same problem:

This is happening because the schema validator tells the XForms code
about the type of the node only if the node is valid. So when the form
is loaded, the XForms code doesn't know <date> contains a date; it
just knows that this field is invalid. Then when you enter a date, the
validator runs again and then tells the XForms code that this is an
xs:date, at which point the XForms engine can switch the appearance of
the field to a date picker.

Obviously, this is not what you want. But it is unclear if we can even
get the validator to tell the XForms code about the type of the node
when it is invalid. So in essence, you can't use a schema to influence
how the <xforms:input> is rendered (text field, date picker,
checkbox); you need to use an <xforms:bind> for that. Of course, you
can still use the schema to validate the data.

BTW, thank you for the use case you attached.

Alex
-- Orbeon Forms - Web forms, open-source, for the Enterprise Orbeon's
Blog: http://www.orbeon.com/blog/ My Twitter: http://twitter.com/avernet


Steven Kerr schrieb:

> ..Bump..
>
> -----Original Message----- (updated)
> From: Steven Kerr
> Sent: Thursday, 26 November 2009 13:37
> To: [hidden email]
> Subject: [ops-users] .xsd schema and forms
>
> People
>
> I am attempting to bind an .xsd schema (separate file) to form
> controls.  It appears I have done this correctly as I have not put any
> type= information into the form bindings, but the input boxes will go
> red if the correct format is not used.
>
> _My question_
> Some of the fields are of type* datetime*.  I have found that if I put
> type="xs:dateTime" in the form binding then it all works fine.  But if I
> leave it out, the form will display a single input box with no
> datepicker. I would like the form get type information from the schema
> and work the same as if I had but it in the form bindings.  Also, what
> is odd is that if I paste in something like:
>
> 2009-11-03T03:00:00
> It will then change into the two separate boxes and display the
> datepicker correctly.
>
> Could anyone shed some light on this?  Is this a bug?  My goal is to
> have all type information in the .xsd schema so that if I change it the
> form will automatically reflect this.
>
> I can post some example files if need be.
>
> Cheers
>
> Steven
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws