Hi,

I've been trying to create a component and I'm struggling with finding out when the richwidgets calendar changes an input date. The problem is the onchange and oninput events aren't fired when a value changes programatically, only by user input. 

Does anyone know a way I could somehow find out when the calendar changes the date (WITHOUT changing the calendar code, because I need my code to work with stock RichWidgets calendar).


 Best Regards, 

Hi,

That's odd, because I have a input widget set like this:

and the RichWidgets\Input_Calendar like this:

 And the action OnDateInputChange gets called automatically when I change the date using the calendar...

What I've noticed is that if you use a date format that isn't YYYY-MM-DD, it only gets correctly converted if you submit the form via AJAX, 

That's right I didn't even think about the fact that OS manages to catch that event if you set an OnChange action. BUT I want to catch it with custom javascript and I'm not being able to...

Thanks for the response anyways

I tried also, with no success! Reading the DOC: http://www.dynarch.com/jscal/

I needed to catch it with a custom event too, to prevent ajax and to do it inside other script.

any thoughts?

Hi Rafael, I'm sure you can do it if you modify the calendar, but I cannot since I want to make a component where the consumer uses his own calendar.

After Carlos pointed out that the platoform manages to catch the event for the screen action, there is indeed a custom event "osonchange" that is fired when the user changes the input. I've yet to test and see if this can solve my problem because I haven't had the time, but when I do I'll post my results here.

Yes, but I wan't clone the widget too.

I'm using the plataform onchange, but it is not the best for me. (calling my js function there).


thx

Rafael Fantato wrote:

Yes, but I wan't clone the widget too.

I'm using the plataform onchange, but it is not the best for me. (calling my js function there).


thx

Yea, do you get some sort of delay before it actually runs?


Afonso Aguas wrote:

Rafael Fantato wrote:

Yes, but I wan't clone the widget too.

I'm using the plataform onchange, but it is not the best for me. (calling my js function there).


thx

Yea, do you get some sort of delay before it actually runs?


Yes, a bit delay.


Ah, what you want to do is quite a bit more complicated...

Going the roundabout way, what you can do is catch the OnChange notification from the widget and in the action call the RunJavaScript action from the HTTPRequestHandler extension to run the JavaScript you need.

Probably...