cancel
Showing results for 
Search instead for 
Did you mean: 

setting date in ce 7.1

Former Member
0 Kudos

hi experts ,

i am using a date type context attribute and i bound it with an input field and in ce 7.1 the date search help is automatically coming, problem is that the initial date is coming like : 1/12/3910 i want it to be set as current date. Please guide me how

to achieve that.

Thank you.

vishavdeep singh

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Suppose u created attribute XYZ of Date type and binded it to an input element.

In the wddoinit() method of the view, write the below code :-

wdContext.currentContextElement().setXYZ(new java.sql.Date( System.currentTimeMillis() ));

Regards

Shruti

pravesh_verma
Active Contributor
0 Kudos

Hi Vishavdeep,

Just need to set the value of the attribute to the current date in wdDoInit method.. Let us say that you have an attribute named "Date" under some context which you have bound to the inputfield.

Then use the sollowing code:


wdContext.current<NODE_NAME>Element().setDate(new java.sql.Date( System.currentTimeMillis()));

I hope this solves your issue. Please revert back in case you need some further help on this.

Thanks and Regards,

Pravesh