You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Harish Krishnaswamy <ha...@gmail.com> on 2004/11/01 13:32:06 UTC

Re: [myWorkSpace] DateTimePicker

Why do you have a StringValidator for a Date field? Try this ...

<bean name="dateValidator" class="org.apache.tapestry.valid.DateValidator">
        <set-property name="format">
			new java.text.SimpleDateFormat("...")  // The format here should
match the Javascript format you specify in the component declaration
        </set-property>
</bean>

        <component id="time" type="myws:DateTimePicker">
               <static-binding name="displayName" value="Date"/>
               <static-binding name="format" value="%b %e %Y %I:%M"/>
               <binding name="validator" expression="beans.dateValidator"/>
               <binding name="value" expression="date"/>
               <binding name="includeWeek" expression="false"/>
       </component>

-Harish


On Sun, 31 Oct 2004 14:41:43 +0200, Alexey Buistov <ja...@ua.fm> wrote:
> Hello,
> 
> I'm trying to utilize DateTimePicker in my application. I started with
> modification of "Tapestry in Action" example illustrating DatePicker. Here's
> what I've changed
> 
> in DatePicker.html:
> ======================
> <form jwcid="@Form" listener="ognl:listeners.formSubmit"
> delegate="ognl:beans.delegate">
> 
> Enter a date: <input jwcid="time"/>
> 
> in DatePicker.page:
> =====================
> <page-specification class="examples.DatePicker">
> 
>    <property-specification name="date" type="java.util.Date"
> persistent="yes"/>
>         <bean name="required" class="org.apache.tapestry.valid.StringValidator"
> lifecycle="page">
>                 <set-property name="required" expression="true"/>
>                 <set-property name="clientScriptingEnabled" expression="false"/>
>         </bean>
>         <bean name="delegate" class="examples.register.RegisterDelegate"/>
>         <component id="time" type="myws:DateTimePicker">
>                 <static-binding name="displayName" value="Date"/>
>                 <static-binding name="format" value="%b %e %Y %I:%M"/>
>                 <binding name="validator" expression="beans.required"/>
>                 <binding name="value" expression="date"/>
>                 <binding name="includeWeek" expression="false"/>
>         </component>
> </page-specification>
> 
> Unfortunately, "date" property is NOT being updated when clicking "Submit"
> button (its always NULL). Please point me to what I did wrong :)
> 
> Thanks,
> Alexey
> ----
> http://rabota.alkar.net/
> 
> ---------------------------------------------------------------------
> 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