cancel
Showing results for 
Search instead for 
Did you mean: 

Set Default Value for a Date Navigator

lakshmi_narayana2
Active Participant
0 Kudos

Hi all

Is it possible to set a default value for a date navigator.I mean with out picking the date from the Navigator, on load of the view itself i need a particualr date to be displayed (say 12/31/2000).

Thanks in advance

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

laksmi,

just set the values in the WDinit() method.

check for which attribute your are using for the date picker.

write the code as

wdContext.currentconextelement.setDate(newDate(System.currentTimeMillis()));

Then when it is loading you can get the default value.

Thanks,

SG

Former Member
0 Kudos

Hi Narmun,

See the link

Hope this helps you

Regards

Rohit

lakshmi_narayana2
Active Participant
0 Kudos

Rohit

My problem is not fully solved.Am able to set the desired default Date.But now the Date Pikcher shows the Year of the Default Date. Ex: If i set the Default Date as 12/31/9999 the Date Picker when clicked shows the same Date.So if the User wants to select a Date in the current Year (2006) its impossible for user to click back arrow in the Date Picker from 9999 to 2006. So is there any way where i can set the Date Picker Value to todays date and the Input field value to Desire Date.

Thanks

Yashpal
Active Contributor
0 Kudos

Hi,

create a value attribute of type date bind to the input field and in wdInit()of view controller write this code..

wdContext.currentContextElement().setValueAttrName(new Date(Calendar.getInstance().getTimeInMillis()));

means ...

u r setting the date entered into some context ....

type of that attribute must be of date and for initial value write the above code ..if it is under node element create nodeelement bind it to context and write the code accordingly..

Message was edited by: Yashpal Gupta

Former Member
0 Kudos

Bind the "firstSelectedDate" property to a context attribute and set the value of this attribute as needed.

Armin

lakshmi_narayana2
Active Participant
0 Kudos

In my case am not using the DateNavigator directly but am using an Inputfield with the context valueattribute type as date.