Baschir,
On Mon, Nov 2, 2009 at 9:59 AM, Baschir Jaghoori
<
[hidden email]> wrote:
> I just encountered a strange behavior with XML Schema type binding and empty
> instance elements. I want to assign date and boolean data types in an XML
> schema file.
>
> When the form is loaded, two text boxes are rendered instead of the expected
> date picker and checkbox. Now when I enter a date in ISO format or
> true/false, the field suddenly turns into date picker / checkbox. Removing
> the date turns the date field into a text field again...
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--
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