cancel
Showing results for 
Search instead for 
Did you mean: 

Prefill with current date - Input Element - How to

Former Member
0 Kudos

Hi

I have a input field bound to a context of type date (basically DatePicker Runtime control) .I want to prefill the input box with current date automatically when the view is shown.

How to acheive that

Thanks

Ananda

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

try this

create a new attribute, which is a string (sNewtext).

bind this attribute to the value property of the inputfild

then put a new action the the event onEnter for the inputfied

for the action use the following code:

wdThis.wdGetContext().currentContextElement().set<snewText>(wdThis.wdGetContext().currentContextElemt.get<datecontext>.getDate.toString());

Hope this will help

Patrick

former_member182372
Active Contributor
0 Kudos

Hi Ananda,

In wdInit put something like:


wdContext.currentContextElement().setDateAttribute(new Date());

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Hi please explain :setDateAttribute(new Date());

Suppose X is the value attribute then setXAttribute is not there also new Date() is showing as undefined constructor.

Thanks

Ananda

former_member182372
Active Contributor
0 Kudos
setX(new java.util.Date())
Former Member
0 Kudos

Maksim,

Actually,

setX(new java.<b>sql</b>.Date())

VS