Hi,
In my page i have 3 date picker, but only 2 are enable. The last one of those is disable and only have a selectedDate when the first 2 one have a date selected. Everything is set from client side on OnDateSelected event.
But i try to get the date from my last datepicker in server side it always return me a null value.
I try to enable the control and it work fine i was able to get the selecteddate. But i can't keep the control enable i absolutly need it disable.
Here is the code i'm using to validate my selecteddate:
Thx for your time,
Guillaume
In my page i have 3 date picker, but only 2 are enable. The last one of those is disable and only have a selectedDate when the first 2 one have a date selected. Everything is set from client side on OnDateSelected event.
But i try to get the date from my last datepicker in server side it always return me a null value.
I try to enable the control and it work fine i was able to get the selecteddate. But i can't keep the control enable i absolutly need it disable.
Here is the code i'm using to validate my selecteddate:
| <script language="javascript" type="text/javascript"> |
| var datePickerAttributionSetter; |
| function InitializedAttributionDateSetter(sender, args) |
| { |
| var datePickerAttribution = $find("<%= RadDatePickerAttribution.ClientID %>"); |
| var datePickerTheoricalExam = $find("<%= RadDatePickerTheroicExam.ClientID %>"); |
| var datePickerPracticalExam = $find("<%= RadDatePickerPracticalExam.ClientID %>"); |
| datePickerAttributionSetter = |
| new QualificationAttribution.QualificationAttributionDateSetter(datePickerAttribution, |
| datePickerTheoricalExam, datePickerPracticalExam); |
| } |
| Sys.Application.add_load(InitializedAttributionDateSetter); |
| </script> |
| QualificationAttribution.QualificationAttributionDateSetter = function(datePickerAttribution, datePickerTheoricalExam, datePickerPracticalExam) |
| { |
| this._datePickerAttribution = datePickerAttribution; |
| this._datePickerTheoricalExam = datePickerTheoricalExam; |
| this._datePickerPracticalExam = datePickerPracticalExam; |
| if ((this._datePickerTheoricalExam != null) && (this._datePickerPracticalExam != null)) |
| { |
| var theoricalSelectedDateHandler = FixHandler(this.OnSelectedDate, this); |
| datePickerTheoricalExam.add_dateSelected(theoricalSelectedDateHandler); |
| datePickerTheoricalExam.add_disposing(function() |
| { |
| datePickerTheoricalExam.remove_dateSelected(theoricalSelectedDateHandler); |
| }); |
| var practicalSelectedDateHandler = FixHandler(this.OnSelectedDate, this); |
| datePickerPracticalExam.add_dateSelected(practicalSelectedDateHandler); |
| datePickerPracticalExam.add_disposing(function() |
| { |
| datePickerPracticalExam.remove_dateSelected(practicalSelectedDateHandler); |
| }); |
| } |
| } |
| QualificationAttribution.QualificationAttributionDateSetter.prototype.OnSelectedDate = function() |
| { |
| var theoricalExamDate = this.GetDate(this._datePickerTheoricalExam); |
| var practicalExamDate = this.GetDate(this._datePickerPracticalExam); |
| if ((theoricalExamDate != null) && (practicalExamDate != null)) |
| { |
| var highestDate = this.GetHighestDate(theoricalExamDate, practicalExamDate); |
| this._datePickerAttribution.set_selectedDate(new Date(highestDate)); |
| } |
| else |
| { |
| this._datePickerAttribution.set_selectedDate(); |
| } |
| } |
| QualificationAttribution.QualificationAttributionDateSetter.prototype.GetDate = function(radDatePicker) |
| { |
| return radDatePicker.get_selectedDate(); |
| } |
| QualificationAttributionDateSetter.prototype.GetHighestDate = function(theoricalExamDate, practicalExamDate) |
| { |
| if ((theoricalExamDate == null) || (practicalExamDate == null)) |
| { |
| return null; |
| } |
| if (theoricalExamDate > practicalExamDate) |
| { |
| return theoricalExamDate; |
| } |
| return practicalExamDate; |
| } |
Thx for your time,
Guillaume
