Setting default value for DateItem()

2011-08-29 Thread mohit ranjan
Using Smart GWT

I am having a DynamicForm with
 Code:

final DateItem dateFromFormItem = new DateItem();
{
dateFromFormItem.setTitle(Date from);
dateFromFormItem.setName(dateFrom);
}

final DateItem dateToFormItem = new DateItem();
{
dateToFormItem.setTitle(Date to);
dateToFormItem.setName(dateTo);
}


I want default value of dateToFormItem to be 24 hr from now (next day), but
could not find any related method.
dateToFormItem default value is current time only as required.

Any hint/help for this will be highly appreciated.

Mohit Ranjan
http://www.flipkart.com

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Setting default value for DateItem()

2011-08-29 Thread Tom Carchrae
dateItem.setDefaultValue(new Date(System.currentTimeMillis() + (24L * 60L *
60L * 1000L)));


On Mon, Aug 29, 2011 at 8:26 AM, mohit ranjan shoonya.mo...@gmail.comwrote:

 Using Smart GWT

 I am having a DynamicForm with
  Code:

 final DateItem dateFromFormItem = new DateItem();
 {
 dateFromFormItem.setTitle(Date from);
 dateFromFormItem.setName(dateFrom);
 }

 final DateItem dateToFormItem = new DateItem();
 {
 dateToFormItem.setTitle(Date to);
 dateToFormItem.setName(dateTo);
 }


 I want default value of dateToFormItem to be 24 hr from now (next day), but
 could not find any related method.
 dateToFormItem default value is current time only as required.

 Any hint/help for this will be highly appreciated.

 Mohit Ranjan
 http://www.flipkart.com

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Setting default value for DateItem()

2011-08-29 Thread mohit ranjan
Thanks Tom.
It's working.

Mohit


On Mon, Aug 29, 2011 at 9:10 PM, Tom Carchrae t...@carchrae.net wrote:


 dateItem.setDefaultValue(new Date(System.currentTimeMillis() + (24L * 60L *
 60L * 1000L)));


 On Mon, Aug 29, 2011 at 8:26 AM, mohit ranjan shoonya.mo...@gmail.comwrote:

 Using Smart GWT

 I am having a DynamicForm with
  Code:

 final DateItem dateFromFormItem = new DateItem();
 {
 dateFromFormItem.setTitle(Date from);
 dateFromFormItem.setName(dateFrom);
 }

 final DateItem dateToFormItem = new DateItem();
 {
 dateToFormItem.setTitle(Date to);
 dateToFormItem.setName(dateTo);
 }


 I want default value of dateToFormItem to be 24 hr from now (next day),
 but could not find any related method.
 dateToFormItem default value is current time only as required.

 Any hint/help for this will be highly appreciated.

 Mohit Ranjan
 http://www.flipkart.com

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.