Currently, there is not, you just want to make sure that the order of
wf:wire calls happens in the order they should appear on the page. If you
need something to happen right after the element is rendered, you can try
manually inserting <script> section at the bottom of the render_element
function in your element module.
That said, I have some new functionality in the works for deferred wiring,
which can help with this, but it's not ready beyond an initial commit that
still hasn't exposed the functionality as an api, so while I can refer you
to this particular feature branch, it won't help basically at all until
The api for this is currently slated to be a sister to wf:wire, and will be
wf:defer. Any functions deferred will be guaranteed to run after all
functions wired with wf:wire, but like wf:wire, will happen in the order
they are called.
Do you think this would help?
On Mon, Nov 5, 2012 at 6:04 PM, Roman Shestakov
> is there a way to control the order in which actions wired to the page?
> 1. I have an element which emits jscript action within render_element
> function via wf:wire call. this action required so element renders
> correctly, e.g. it is a call to some jQuery func.
> 2. I also have another action wired to the instance of the element outside
> render_element function , which just does something to the control every
> time a page loads.
> when page is created and nitrogen emits the jscript to the page, action
> #2 might be executed *before* #1 and element won't be rendered correctly
> is there any way to control the order of jscript functions outputted to
> the page?
> Regards, Roman
> You received this message because you are subscribed to the Google Groups
> "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
> To post to this group, send email to firstname.lastname@example.org.
> To unsubscribe from this group, send email to
> For more options, visit this group at
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm