You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Galen Meurer <si...@galenmeurer.com> on 2004/08/21 19:50:37 UTC
Re: DateTimePicker and FieldLabel during validation....
I had the same problem in converting from the ValidDatePicker to Harish's
DateTimePicker.
The below suggestion gets rid of the error (" Display name not specified and
not provided by field"), but if you don't define the displayName on the
ValidField, the error messages can't get the name and the messages become
"Invalid date format for null. Format is dd-MMM-yyyy."
It happens with both these forms:
<binding name="displayName" expression='getMessage("birthDate")'/>
<static-binding name="displayName" value="Birth Date:"/>
In both instances in a debugger, the displayNameBinding is visible and has a
value but the getDisplayName returns null. At which point, it hits me -- it
must be Tapestry direction.
ValidField:
<parameter name="displayName" type="java.lang.String" required="yes"
direction="auto">
DateTimePicker:
<parameter name="displayName" type="java.lang.String" direction="in"
required="no"/>
It doesn't make much sense to me to have a ValidField that doesn't require a
displayName, so I've patched the DateTimePicker.jwc to match the ValidField.
I also went ahead and upgraded to the jscalendar v 0.9.6. I've uploaded this
jar to Harish's sourceforge project
(http://sourceforge.net/tracker/index.php?func=detail&aid=1013480&group_id=8
3073&atid=568234)
The only other workaround I can think of is to define the displayName on
both the FieldLabel and the DateTimePicker. If you have a lot of these,
though, that's a lot of duplication.
Thanks for sharing this component, Harish. It's very nice.
G;
----- Original Message -----
From: "Harish Krishnaswamy" <hk...@comcast.net>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Saturday, July 10, 2004 1:45 PM
Subject: Re: DateTimePicker and FieldLabel during validation....
> I am doing this all over the place and I don't have a problem. If you
> can post relevant snippets, it'll help I suppose. Here's an example of
> my usage:
>
> <component id="spottingDateLabel" type="FieldLabel">
> <binding name="field" expression="components.spottingDate"/>
> <static-binding name="displayName" value="Spotting Date" />
> </component>
> <component id="spottingDate" type="myws:DateTimePicker">
> <binding name="value" expression="maldiRun.spottingDate" />
> <binding name="validator" expression="beans.dateValidator" />
> <binding name="pickerImage" expression="assets.datePicker" />
> <binding name="disabled" expression="maldiRun.closed" />
> </component>
>
> -Harish
>
> kdorff@kcp.com wrote:
>
> >What I am trying to do may be impossible, but, I might as well ask.
> >
> >Because I need a field with both Date _and_ Time and because I want
> >validation on that field, I have started using the DateTimePicker
> >component provided in Harish's "myws" library. This seems to work well,
it
> >is allowing me to input both date and time in one field, converting to
> >"java.util.Date" in my object, doing the appropriate validation, I am
> >quite happy with it. I would like to extend the validation using the
> >"FieldLabel" component but when I point the FieldLabel's "field" property
> >at the "DateTimePicker" it doesn't recognize that the component is there
> >
> > Display name not specified and not provided by field
> >Add/incidentDateDateTimePicker.
> >
> >Am I pretty much stuck with this as I assume I am?
> >
> >Thanks for any assistance.
> >
> >Is there an alternate input method that will help me with validation of
> >date _and_ time into a single java.util.Date in my object?
> >
> >Kevin
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: DateTimePicker and FieldLabel during validation....
Posted by Harish Krishnaswamy <ha...@gmail.com>.
Thanks for the patch, Galen. This has been applied and the
new jar has been released. I have updated the DateTimePicker
script to 0.9.6 and it seems to be working fine, if you have
a problem, please let me know.
-Harish
On Sat, 21 Aug 2004 10:50:37 -0700, Galen Meurer <si...@galenmeurer.com> wrote:
> I had the same problem in converting from the ValidDatePicker to Harish's
> DateTimePicker.
>
> The below suggestion gets rid of the error (" Display name not specified and
> not provided by field"), but if you don't define the displayName on the
> ValidField, the error messages can't get the name and the messages become
> "Invalid date format for null. Format is dd-MMM-yyyy."
>
> It happens with both these forms:
>
> <binding name="displayName" expression='getMessage("birthDate")'/>
> <static-binding name="displayName" value="Birth Date:"/>
>
> In both instances in a debugger, the displayNameBinding is visible and has a
> value but the getDisplayName returns null. At which point, it hits me -- it
> must be Tapestry direction.
>
> ValidField:
> <parameter name="displayName" type="java.lang.String" required="yes"
> direction="auto">
>
> DateTimePicker:
> <parameter name="displayName" type="java.lang.String" direction="in"
> required="no"/>
>
> It doesn't make much sense to me to have a ValidField that doesn't require a
> displayName, so I've patched the DateTimePicker.jwc to match the ValidField.
> I also went ahead and upgraded to the jscalendar v 0.9.6. I've uploaded this
> jar to Harish's sourceforge project
> (http://sourceforge.net/tracker/index.php?func=detail&aid=1013480&group_id=8
> 3073&atid=568234)
>
> The only other workaround I can think of is to define the displayName on
> both the FieldLabel and the DateTimePicker. If you have a lot of these,
> though, that's a lot of duplication.
>
> Thanks for sharing this component, Harish. It's very nice.
>
> G;
>
> ----- Original Message -----
> From: "Harish Krishnaswamy" <hk...@comcast.net>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Saturday, July 10, 2004 1:45 PM
> Subject: Re: DateTimePicker and FieldLabel during validation....
>
> > I am doing this all over the place and I don't have a problem. If you
> > can post relevant snippets, it'll help I suppose. Here's an example of
> > my usage:
> >
> > <component id="spottingDateLabel" type="FieldLabel">
> > <binding name="field" expression="components.spottingDate"/>
> > <static-binding name="displayName" value="Spotting Date" />
> > </component>
> > <component id="spottingDate" type="myws:DateTimePicker">
> > <binding name="value" expression="maldiRun.spottingDate" />
> > <binding name="validator" expression="beans.dateValidator" />
> > <binding name="pickerImage" expression="assets.datePicker" />
> > <binding name="disabled" expression="maldiRun.closed" />
> > </component>
> >
> > -Harish
> >
> > kdorff@kcp.com wrote:
> >
> > >What I am trying to do may be impossible, but, I might as well ask.
> > >
> > >Because I need a field with both Date _and_ Time and because I want
> > >validation on that field, I have started using the DateTimePicker
> > >component provided in Harish's "myws" library. This seems to work well,
> it
> > >is allowing me to input both date and time in one field, converting to
> > >"java.util.Date" in my object, doing the appropriate validation, I am
> > >quite happy with it. I would like to extend the validation using the
> > >"FieldLabel" component but when I point the FieldLabel's "field" property
> > >at the "DateTimePicker" it doesn't recognize that the component is there
> > >
> > > Display name not specified and not provided by field
> > >Add/incidentDateDateTimePicker.
> > >
> > >Am I pretty much stuck with this as I assume I am?
> > >
> > >Thanks for any assistance.
> > >
> > >Is there an alternate input method that will help me with validation of
> > >date _and_ time into a single java.util.Date in my object?
> > >
> > >Kevin
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
--
~~~~~~~~~~~~~~~~
Harish Krishnaswamy
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org