- When events are configured on server connect, do the global events sitll get fired?
- In the global event, do we get any reference of the SC for which the global event is being fired? Above doc shows that response data is available, but I am asking about the SC itself, not its result.
Hi Sid,
- When events are configured on server connect, do the global events sitll get fired?
Yes, they will still get fired.
- In the global event, do we get any reference of the SC for which the global event is being fired? Above doc shows that response data is available, but I am asking about the SC itself, not its result.
The available options are currently status and response only.
Maybe it would be a good idea to include the id of the server action/component that triggers the error @patrick ?
Ideally there would be a way to detect if the underlying SC was also handling such events, so we could avoid e.g. showing duplicate notifications, because existing apps will likely have error handling on some Server Connects already
Can this be improved to not bubble the event?
Otherwise it sort of becomes unusable - at least for my projects.
Only thing I can configure is unauthorized - everything else usually has the need for both common and specific configuraiton.
When it doesn't bubble it will only trigger on the serverconnect element and not on the elements above it. You can use dmx-on:xhrsuccess.stop="" to stop propagation.
An other way is to group your serverconnect elements which you want to do something with.
<section dmx-on:xhrsuccess="doSomething()">
<dmx-serverconnect id="sc1" action="..."></dmx-serverconnect>
<dmx-serverconnect id="sc2" action="..."></dmx-serverconnect>
</section>
<dmx-serverconnect id="sc3" action="..."></dmx-serverconnect>
The above will only listen for success of sc1 and sc2 but not from sc3.
I will add the serverconnect name to the data so that it can be recognized.
I've added source as new property to the event, it will contain the name of the component that triggered the event.
dmxAppConnect.zip (121.4 KB)