DateRange component events

Hi!
I need to fire event when I move DateRange component slider.
I was trying to do that with MouseReleased event, but it does not work on slider himself.
It works on every other place of DateRange component around that slider, but not on slider.
How is it possible to fire MouseReleased event on DateRange slider?

Thanks.

You don’t use the mouseReleased event but rather the propertyChange event. It fires anytime a property on that component changes. So for the date range you can do this:if event.propertyName in ["startDate", "endDate"]: # do your code here .....

Thank you.

Now I have such problem, that if I change DateRange component endTime and startTime, sometimes my code behind DateRange component event handler runs two times.
I change endTime and startTime like this:

event.source.parent.getComponent('Date Range').endDate = newEndDate
event.source.parent.getComponent('Date Range').startDate = newStartDate

And it seems that event fires on every date change, first time on endDate change and second time on startDate change.
Is it possible to change endDate and startDate at once, at the same time?

No, you will get two property changes. However, you can run your script in an invokeLater function which will happen after both values update.

Thing is that I am changing DateRange times from several places, not only by dragging slider. But I also want to drag it and fire my event behind that also. I have a time change panel, where I control endTime and startTiime of DateRange component and also dragging a slider possibility. This DateRange component controls my ClassicChart datasets by refreshing queries. And now those queries run double. Are you having plans to add Event Handler to DateRange slider itself as well?

I understand. We don’t have any plans right now to fix that. You can add a button to the window that they can click on to refresh the data.

Ok, I made multiple queries run behind button using system.db.runQuery(“query”) for every dataset in Classic Chart and using invokeAsynchronous, to run them all at once in separate threads.
Now I am not able to indicate datasets loading using Chart propertiesLoading, because query excecutes in system function and Chart datasets filling runs so fast, that I don’t even see it. I putted indicator visibility to 1 behind RunQueries button, but I don’t know how to turn visibility off, because I don’t know how to get when Chart datasets finish loading.
Could you help me somehow with that?

Sure, you can put a progress bar or image on the screen that shows it is loading. In your script you can show/hide the progress bar like this:[code]def doAsynch(event=event):
import fpmi

def doLater(event=event):
    event.source.parent.getComponent("Progress Bar").visible = 1
fpmi.util.invokeLater(doLater)

....... # your code

def doLater(event=event):
    event.source.parent.getComponent("Progress Bar").visible = 0
fpmi.util.invokeLater(doLater)

fpmi.util.invokeAsynchronous(doAsynch)[/code]You have to use a invokeLater to change any properties on the screen.