How to trigger shape event

Find and share HowTos to various installations / configurations!
4 posts • Page 1 of 1
teemu_ylonen
Posts:10
Joined: Tue Jun 30, 2020 3:51 pm

How to trigger shape event

Post by teemu_ylonen »

Hello,
I have a slider component on panel and want to change datapoint element connections based on slider value.
This is working OK but because dpConnect and dpDisconnect functions must be called from the same script, how could I initialize connections when panel is opened ? Slider change event updates connections but how to trigger that event manually with default value ?

Regards, Teemu

teemu_ylonen
Posts:10
Joined: Tue Jun 30, 2020 3:51 pm

Re: How to trigger shape event

Post by teemu_ylonen »

No can do thing ? It is also useful information

adaneau
Posts:310
Joined: Tue Feb 21, 2012 9:49 am

Re: How to trigger shape event

Post by adaneau »

Hi,

You could use a function from scope lib inside your event instead of direct coding. Then call this function in init. Be careful however as your disconnect will not work at init as nothing will be connected.

BR
Alex

teemu_ylonen
Posts:10
Joined: Tue Jun 30, 2020 3:51 pm

Re: How to trigger shape event

Post by teemu_ylonen »

Hi Alex and thank you for your reply.
If you call dpConnect in panel init, then you will get warnings when doing dpDisconnect on slider event. After trying several things, my solution was to do both dpConnect and dpDisconnect on slider event. Then in panel initialization trigger manually slider event by setting slider value something else than zero. This will generate slider event and panel can be initialized. Not the most elegant way but it seems to be working.

Regards, Teemu

4 posts • Page 1 of 1