Hi again! My mistake!
Yes, I did the translator binding but I forgot to change the datatype from String to Date in my page-class. I works!!! Thanks a lot guys, especially Paul, it would have taken me weeks to come up with this. Two issues left: - How do I apply the required validator to the Date2? - My date translator does not seem to be localized... do I need to do something to get that? Malin On 6/17/06, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:
Did you also do the "translator" binding? On 6/17/06, Malin Ljungh <[EMAIL PROTECTED]> wrote: > > OK, I tried it... I think I'm close but I get this: > Error initializing property minDate of bean 'minDate' (of component > EditEvent): Error converting value for initializer of property minDate: No > type converter for type java.util.Date is available. > > EditEvent is the name of my page. > > Also, I wonder how can I apply a required validator to the Date2? Date1 is > no problem, I just added > <binding name="validators" value="validators:required"/> > and on the Date2 I tried this: > <binding name="validators" > value="validators:required,bean:minDate"/> > but that is obviously wrong... help me please? > > /Malin > > > On 6/17/06, Malin Ljungh <[EMAIL PROTECTED]> wrote: > > > > Thank you Paul!!! > > I'll try that immedeately! > > > > Malin > > > > > > > > On 6/16/06, Paul Ferraro <[EMAIL PROTECTED]> wrote: > > > > > > This should work: > > > > > > <bean name="minDate" class=" org.apache.tapestry.form.validator.MinDate" > > > lifecycle="none"> > > > <!-- Use the property to which your Date1 value is bound --> > > > <!-- The "none" lifecycle will ensure that the bean isn't created > > > until needed --> > > > <set name="minDate" value="date1"/> > > > </bean> > > > > > > <component id="Date1" type="TextField"> > > > <binding name="value" value="date1"/> > > > <binding name="translator" value="translator:date"/> > > > </component> > > > > > > <component id="Date2" type="TextField"> > > > <binding name="value" value="date2"/> > > > <binding name="translator" value="translator:date"/> > > > <binding name="validators" value="bean:minDate"/> > > > </component> > > > > > > Paul > > > > > > Malin Ljungh wrote: > > > > Hi all, > > > > > > > > I'm a newbie and just too tired think right now. Please help me :) > > > > > > > > I have a form with two TextFields where the user should enter somes > > > > dates. I > > > > use the date validator to check that correct dates are supplied. > > > > Though, I need to check that date2 < date1 - how can I do this? Can > I > > > use > > > > the minDate and give the other date value as parameter? Hmm, I guess > > > > not? I > > > > suppose I need to write my own ValidationDelegeate... is this the > > > > right way > > > > to go? > > > > > > > > Regards, > > > > Malin > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > -- Jesse Kuhnert Tacos/Tapestry, team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind.