Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion order of jscript actions wired to the page?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jesse Gumm  
View profile  
 More options Nov 5 2012, 9:34 pm
From: Jesse Gumm <g...@sigma-star.com>
Date: Mon, 5 Nov 2012 20:33:55 -0600
Local: Mon, Nov 5 2012 9:33 pm
Subject: Re: order of jscript actions wired to the page?

Hello Roman,

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
it's done.

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?

-Jesse

On Mon, Nov 5, 2012 at 6:04 PM, Roman Shestakov
<roman.shesta...@gmail.com>wrote:

> hello,

> is there a way to control the order in which actions wired to the page?

> e.g.

> 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 nitrogenweb@googlegroups.com.
> To unsubscribe from this group, send email to
> nitrogenweb+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/nitrogenweb?hl=en.

--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.