on 01-09-2007 10:41 AM
Hi experts,
i've read a lot of threads in the forum but i've haven't found any answers to my question.
here is the code of my wdInit method in my StartView:
public void wdDoInit()
{
//@@begin wdDoInit()
String date_deb_init = new String("01/01/1900");
String date_fin_inti = new String("31/12/9999");
SimpleDateFormat sdf = new SimpleDateFormat("dd/mm/yyyy");
try {
wdContext.currentContextElement().setValDate_start(
(java.sql.Date) sdf.parse(date_deb_init));
wdContext.currentContextElement().setValDate_end(
(java.sql.Date) sdf.parse(date_fin_inti));
} catch (Exception e) {
wdContext.currentContextElement().setAffichage(e.getMessage());
}
//@@end
}
but, after execution, the 2 inputfields are still empty.
I don't under stand why it don't pass in the
try
block ...
hi,
use this code
java.util.Date tempDate = Calendar.getInstance().getTime();
Date sqlDate = new Date(tempDate.getTime());
wdContext.currentContextElement().setDate1(sqlDate);
where Date1 is the value attribute. This code will set the Date attribute with the current date.
Regards,
Gopi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
java.sql.Date Today = new java.sql.Date(
Calendar.getInstance().get(Calendar.YEAR)-1900,
Calendar.getInstance().get(Calendar.MONTH),
Calendar.getInstance().get(Calendar.DAY_OF_MONTH) );
wdContext.currentContextElement().setValDate_start(Today);
Be sure that <b>ValDate_start</b> attribute is type Date and not java.util.Date
Hi ,
try this.
long time = System.currentTimeMillis();
java.sql.Date dt = new java.sql.Date(time);
wdContext.currentContextElement().setOne(dt);
Here one value attribute should be date .
Thanks,
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.