Skip to Content

Is there any possibility in "Component SDK Development" to fire events in contribution.ztl?

Hi,

I'm developing a "Component SDK" for the Lumira Designer. We have a component with an event "onLoad", which should execute some custom Design Studio script.

I know, we can fire this event from client javascript using fireEvent("onLoad"). However, I'm just wondering if there is any simple solution to fire this event from server side (in contribution.ztl).

A workaround is to change a component property in a ztl method, which triggers the component setter on the client side, where we can call fireEvent("onLoad"), which finally results in a server roundtrip again...

As we start on the server side and end on the server side, this way (server-client-server) seems to be unnecessary.

So, is there any possibility to fire events in contribution.ztl on server side?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Dec 07, 2017 at 11:35 AM

    Florian,

    Events are not supposed to be fired from a ZTL function. Although ZTL functions are executed on the server side, they are always called from the client side. Even if it were possible to trigger an event within a ZTL, how were you expecting to trigger the ZTL function from the server side? This is not possible.

    I understand your concern about unnecessary server round-trips but this is the way Lumira Designer has been architected so you must develop your SDK component accordingly.

    In any case, I would have thought that it makes more sense to trigger an "onLoad" event from the client side because presumably this should occur when the component is initialised or rendered.

    Regards,

    Mustafa.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Mustafa,

      yeah, that's a good point. I was just wondering if there is a possibility that I do not yet know, apart from a real scenario.

      But you are right, there are other ways and possibilities to develop the SDK component according to the architecture.

      Thank you.

      Regards,

      Florian.