Code Studio - Fire a Signal

In Code Studio I’m creating an alternate presenter for Links and Action Links. All is fine for most things (link, delete, pend, fire event etc) but I can’t see how to fire a signal. I tried cs.fire_event(signal_ref) but that doesn’t do anything. There doesn’t appear to be a similar call for signals, eg cs.fire_signal(ref).
Does anyone know how to fire a signal in Code Studio?

Ideally, since I’m just changing the presentation, I’d prefer it if I could just pass the action through to the existing Action link then I wouldn’t have to recreate the functionality for each of the possible actions.

Another problem I have is that with the standard action links, when the action is taken, the page data refreshes (not the whole page) so the relevant line item in a list disappears when a standard Delete Action link is pressed. In my presenter this refresh doesn’t happen even though the delete or event is invoked. I added a window.location.reload() to the frontend which works but looks ugly.
Any ideas on how to refresh the page data in code studio without a page reload?

Hi Chris,

We don’t have the option within Code Studio to fire a single.
But we should!
Please register an idea for this (see link in top nav).
We should be able to turn that around fairly quickly.

Rules can trigger signals (via setting a scope of ‘global action’), so in some contexts you might be able to (ab)use that.

There is a cs.redirect() function you can try. But this doesn’t work in some contexts.

I would be interested to know why you needed to create these presenters. The fragments themselves have a handful of settings, like being able to present as a button and specify its colour and size.
You can also style them with a stylesheet, via their standard classes or classes you add on individual fragments).

Paul

1 Like