There is a way to express this in XForms 1.1:
Use the date type in the XForms namespace, which is defined as union of
empty and xsd:date.
Processors should give you this effect when you use the unqualified names:
<bind nodeset="foo" type="date" />
See http://www.w3.org/TR/xforms11/#empty-content-types
In an XForms 1.0 processor, you can do the same thing by defining your
own type to be a union of xsd:date and the empty string.
Leigh.
On 03/09/2011 08:11 AM, Philip Fennell wrote:
>
> Florent wrote:
>
> > Isn't that the purpose of xf:bind/@required?
> > Which anyway has the default "false".
>
> The issue with xs:date, for example, is that a value of '' is not a
> valid date and cases where a field that contains a non-mandatory date
> the type xs:date cannot be used but the user may still desire a
> date-picker control. I wonder whether the appearance attribute has a
> role in this but that'd be purely implementation dependant.
>
> The only practical work around is to use a check box to control the
> relevance of the date field and then the problem goes away because no
> validation errors will be generated until the field is enabled.
>
>
> Regards
>
> Philip
>
>
> -----Original Message-----
> From: Florent Georges [mailto:li...@fg...]
> Sent: 09 March, 2011 4:03 PM
> To: xsl...@li...; Philip Fennell
> Subject: Re: [Xsltforms-support] Can you use the date picker without
> setting the type to xs:date?
>
> Philip Fennell wrote:
>
> Hi,
>
> > If I set the type attribute on an xf:bind to xs:date then a
> > date picker is rendered for a control that uses that bind.
> > However, the xs:date type does not allow for empty values and
> > therefore cannot be used where a date field might have no
> > value.
>
> Isn't that the purpose of xf:bind/@required? Which anyway has
> the default "false".
>
> Regards,
>
> --
> Florent Georges
> http://fgeorges.org/
>
>
>
>
>
> ------------------------------------------------------------------------------
>
> Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit
> for your organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> _______________________________________________
> Xsltforms-support mailing list
> Xsl...@li...
> https://lists.sourceforge.net/lists/listinfo/xsltforms-support
>
|