Thanks Thiago,
I have managed to do the job. What's not funny, I have had a bug in the
setupRender code, that's why it previously was not working for me.

So the solution was to set the values just like that (in setupRender method
of my *Activities *page):


if((activitiesFilterControl != null) &&
(activitiesFilterControl.getDateFrom() == null) &&
(activitiesFilterControl.getDateTo() == null))
{

Date now = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(now);
calendar.add(Calendar.MONTH, -1);

activitiesFilterControl.setDateTo(now); // now
activitiesFilterControl.setDateFrom(calendar.getTime()); // one month before now

}

In this way, the dates are set only if this is the first time user
visits the page (the are @Persistent, so will be saved).

Thanks again for help:)



2015-10-13 14:32 GMT+02:00 Thiago H de Paula Figueiredo <thiag...@gmail.com>
:

> On Tue, 13 Oct 2015 01:59:43 -0300, g kuczera <gkucz...@gmail.com> wrote:
>
> Hi everyone,
>>
>
> Hi!
>
> I am a beginner with Tapestry and I have a specific question.
>>
>
> Welcome!
>
> As I understand, I just have to set the value parameter by setting the
>> dateTo/dateFrom variables, is that right?
>>
>
> Yes! Just do it inside the onActivate() or onPrepareForRender() methods.
> DateField (and any other form field component) will render the HTML field
> with the value in the property bound to it.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

Reply via email to