cancel
Showing results for 
Search instead for 
Did you mean: 

Date Disabling

Former Member
0 Kudos

Hi All

I have problem with Date for me the requirement is the user can select 1st of EveryMonth

remaining other dates should be disabled.how couold i do it .please help me to solve this problem.

Thanks&Regards

Asif

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Asif,

I do not know, whether you have a compulsion of using a particular UI element. If not, I would suggest you to use two dropdowns, one for months and the other one for year. You can use Simple Types for Months and Years.

This approach will decrease the coding effort and will give a wide range of date options, without the user clicking for every month.

Hope this helps. If you need some more help, you can get back, I'll be happy to do so.

Cheers!!!

Umang

Former Member
0 Kudos

hi Asif

try this

simpletype of Built in type Date .. binded with input field ...

Calendar calendar = new GregorianCalendar(2007, 0, 1);

Date date = new Date(calendar.getTimeInMillis());

SimpleDateFormat f = new SimpleDateFormat("dd-MM-yyyy");

String formatedDate=f.format(date);

wdComponentAPI.getMessageManager().reportSuccess("the date"+formatedDate);

Final out put will be 01-01-2007

that's u can get only 01-01-2007 all other date fields disabled ...... i hope this code 'll help you ...

Former Member
0 Kudos

Thanks Ramprasad for reply

But actually by using this we can disable the only 2007 dates how about 2008,2009 and so on

it should change dynamically.so what shall i do.

Thanks & Regards

Asif

Former Member
0 Kudos

hi !

create an event for onselect if you are using dropdown.

then in the for loop get the values with the help of following code

wdContext.currentDDIndexElement().getValue();

and then disable elements .

thanks

vishal

Edited by: Vishal Anand on Sep 26, 2008 11:38 AM

Former Member
0 Kudos

Hi Asif

You did not mentioned, which UI element you are using for displaying date fileds. You can disable them by mapping the desired ui element to contextattribute which is of boolean type and according to your requrement you can set that booleantype attribute as true/false, by which the corresponding ui element which is bound will get disabled or enabled.

Regards

Raghu