Page 1 of 1

IWCGJQDatePicker current text?

PostPosted: 29 Sep 2014 20:56
by kattunga
Hi I want to validate in server side the text that a user typed in a IWCGJQDatePicker.
But the only property that I have is "Date" and this property have value 0 if text is a wrong date so I can't know if it's a wrong date or if date is empty.
Is there any way to get the original text?

Re: IWCGJQDatePicker current text?

PostPosted: 29 Sep 2014 21:49
by Jorge Sousa
Hi

The easiest way for both :) is if you add a BrowserParam into the event when you want to validate

BrowserParam.BrowserScript:= '$(<#DatePicker1#>).val()';
BrowserParam.ServerName:= 'DatePicker1Val';

Re: IWCGJQDatePicker current text?

PostPosted: 29 Sep 2014 23:59
by kattunga
I found easiest to solve it changing sourcecode:

Code: Select all
  TIWCGJQCustomDatePicker = class..
  private
    ...
    FText: string;
  public
    ...
    property Text: string read FText;
  end;

procedure TIWCGJQCustomDatePicker.SetDate(const Value: TDate);
...
    FText := s;
    JQDatePickerOptions.SetDefaultDate(s);
...

procedure TIWCGJQCustomDatePicker.SetValueByName(const AName, AValue : string);
...
    FText := AValue;
  end else if Assigned(FJQValidateOptions) ...
...

Re: IWCGJQDatePicker current text?

PostPosted: 01 Oct 2014 15:00
by Jorge Sousa
Hi

Is a very good suggestion, we're going to implement as soon as possible.