Text field for date entry

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

Text field for date entry

Dustin Henson-2
I have a newbi question about date fields in xforms. I'm sure there is an easy way to do this, but it is escaping me. I've been asked to add a text field next to a date button allowing the user to type the date OR use the calendar button to set it. Initially I tried adding a second binding to the date node like this:

<xforms:bind id="IncidentDateBind"
             type="xs:date"
             nodeset="instance('default-instance')/IncidentDate"
             required="(instance('config-instance')/IncidentDate = 1)"/>
<xforms:bind id="IncidentDateTextBind"
             type="xs:string"

             nodeset="instance('default-instance')/IncidentDate"

             required="(instance('config-instance')/IncidentDate = 1)"/>

However, it seems the type in the second binding overwrites the type info in the first causing both inputs to show a text.

I see calendar buttons next to date text fields all over the web so I'm sure there's a way. Can anyone point me to an example of how to do this?

Thanks,
Dustin

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Text field for date entry

Erik Bruchez
Administrator
Dustin,

Currently, Orbeon Forms automatically show a calendar for date input.  
We are not happy about this, but there is currently no option to also  
have a text field in addition. See this RFE:

  http://forge.objectweb.org/tracker/index.php?func=detail&aid=306172&group_id=168&atid=350207

Your example doesn't work in part because an element or attribute can  
only have one type. XForms in fact makes it illegal to bind two types  
to the same element or attribute, and we should probably raise an  
exception in that case.

If you want to achieve this without changing the Orbeon Forms code,  
you will have to do more work. Your input field will have to be bound  
to another element or attribute in the instance. You will then have to  
copy data back and forth between the two places, for example by  
reacting to xforms-value-changed and using xforms:setvalue.

Ideally, again, this would be a built-in feature. We also hope that  
once we have our component system setup, this kind of things will be  
much easier:

  https://wiki.objectweb.org/ops/Wiki.jsp?page=XFormsComponents

-Erik

On Nov 28, 2007, at 11:12 AM, Dustin Henson wrote:

> I have a newbi question about date fields in xforms. I'm sure there  
> is an easy way to do this, but it is escaping me. I've been asked to  
> add a text field next to a date button allowing the user to type the  
> date OR use the calendar button to set it. Initially I tried adding  
> a second binding to the date node like this:
>
> <xforms:bind id="IncidentDateBind"
>             type="xs:date"
>             nodeset="instance('default-instance')/IncidentDate"
>             required="(instance('config-instance')/IncidentDate =  
> 1)"/>
> <xforms:bind id="IncidentDateTextBind"
>             type="xs:string"
>             nodeset="instance('default-instance')/IncidentDate"
>             required="(instance('config-instance')/IncidentDate =  
> 1)"/>
>
> However, it seems the type in the second binding overwrites the type  
> info in the first causing both inputs to show a text.
>
> I see calendar buttons next to date text fields all over the web so  
> I'm sure there's a way. Can anyone point me to an example of how to  
> do this?
>
> Thanks,
> Dustin
>
> --
> 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
--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
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
Reply | Threaded
Open this post in threaded view
|

Re: Text field for date entry

ilangostl
In reply to this post by Dustin Henson-2
Hi Dustin
Have you managed to implement this control? I have been trying to address this issue from my end so far, with not much success.
 
thanks
ilango

 
On 11/28/07, Dustin Henson <[hidden email]> wrote:
I have a newbi question about date fields in xforms. I'm sure there is an easy way to do this, but it is escaping me. I've been asked to add a text field next to a date button allowing the user to type the date OR use the calendar button to set it. Initially I tried adding a second binding to the date node like this:

<xforms:bind id="IncidentDateBind"
             type="xs:date"
             nodeset="instance('default-instance')/IncidentDate"
             required="(instance('config-instance')/IncidentDate = 1)"/>
<xforms:bind id="IncidentDateTextBind"
             type="xs:string"

             nodeset="instance('default-instance')/IncidentDate"

             required="(instance('config-instance')/IncidentDate = 1)"/>

However, it seems the type in the second binding overwrites the type info in the first causing both inputs to show a text.

I see calendar buttons next to date text fields all over the web so I'm sure there's a way. Can anyone point me to an example of how to do this?

Thanks,
Dustin


--
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: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.ow2.org/wws" target="_blank"> http://www.ow2.org/wws




--
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
Reply | Threaded
Open this post in threaded view
|

Re: Text field for date entry

Dustin Henson-2
Hi Ilango,

No I haven't. It appears that doing so would be a manual coding effort. We had to defer this issue for now because of the complexity. Below is the email response I received from an Orbeon developer:


Erik Bruchez wrote:
Dustin,

Currently, Orbeon Forms automatically show a calendar for date input. We are not happy about this, but there is currently no option to also have a text field in addition. See this RFE:

 http://forge.objectweb.org/tracker/index.php?func=detail&aid=306172&group_id=168&atid=350207

Your example doesn't work in part because an element or attribute can only have one type. XForms in fact makes it illegal to bind two types to the same element or attribute, and we should probably raise an exception in that case.

If you want to achieve this without changing the Orbeon Forms code, you will have to do more work. Your input field will have to be bound to another element or attribute in the instance. You will then have to copy data back and forth between the two places, for example by reacting to xforms-value-changed and using xforms:setvalue.

Ideally, again, this would be a built-in feature. We also hope that once we have our component system setup, this kind of things will be much easier:

 https://wiki.objectweb.org/ops/Wiki.jsp?page=XFormsComponents

-Erik
Hope that helps. The good news is that it sounds like they plan to add the feature later.

-Dustin

XGuy wrote:
Hi Dustin
Have you managed to implement this control? I have been trying to address this issue from my end so far, with not much success.
 
thanks
ilango

 
On 11/28/07, Dustin Henson <[hidden email]> wrote:
I have a newbi question about date fields in xforms. I'm sure there is an easy way to do this, but it is escaping me. I've been asked to add a text field next to a date button allowing the user to type the date OR use the calendar button to set it. Initially I tried adding a second binding to the date node like this:

<xforms:bind id="IncidentDateBind"
             type="xs:date"
             nodeset="instance('default-instance')/IncidentDate"
             required="(instance('config-instance')/IncidentDate = 1)"/>
<xforms:bind id="IncidentDateTextBind"
             type="xs:string"

             nodeset="instance('default-instance')/IncidentDate"

             required="(instance('config-instance')/IncidentDate = 1)"/>

However, it seems the type in the second binding overwrites the type info in the first causing both inputs to show a text.

I see calendar buttons next to date text fields all over the web so I'm sure there's a way. Can anyone point me to an example of how to do this?

Thanks,
Dustin


--
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: <a moz-do-not-send="true" onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.ow2.org/wws" target="_blank"> http://www.ow2.org/wws




--
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