Monday, August 30, 2010

Set the month in the datepicker

Hi,

I have 2 dates FromDate and ToDate. I used the datebox to show the
dates. My requirement is when the user selects the some dates in the
fromdate, I need to show the same month in the Todate's datepicker.

I have used the following , but it shows the date in the todate's
datebox. I just want to navigate to the month in the todate's
datepicker ( with respect to fromdate) and it should not come in the
datebox.

txtFromDate.addValueChangeHandler(new ValueChangeHandler<Date>() {
int pog = 0;
public void onValueChange(ValueChangeEvent<Date> event) {
if (pog%2==0){

txtToDate.getDatePicker().setValue(txtFromDate.getValue(),true);

}
pog++;
}
});

toDate.getDatePicker().setValue(fromDate.getValue(),true);

Please advice.

Thanks
Siva.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment