How to trigger event after small timeout?

54 views
Skip to first unread message

Max Lapshin

unread,
Jun 1, 2012, 11:01:07 AM6/1/12
to nitro...@googlegroups.com
I want event to be triggered after some time of page load. How can I do this?


body() ->
wf:wire(#event{type = system, postback = change}),
....

event(change)

doesn't work for me.

Jesse Gumm

unread,
Jun 1, 2012, 2:06:53 PM6/1/12
to nitro...@googlegroups.com
Hi Max.

You're almost there.

If you want the event to fire after X number of milliseconds, do:

wf:wire(#event{type=timer, delay=X, postback=change}).

However, if you want the event to fire immediately, you should be able
to get away with just:

wf:wire(#event{postback=change}).

-Jesse
> --
> 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 nitro...@googlegroups.com.
> To unsubscribe from this group, send email to nitrogenweb...@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

Yu-ri Cho

unread,
Jun 1, 2012, 2:07:48 PM6/1/12
to nitro...@googlegroups.com
how about something like this

body() ->
#event{type=onload, postback=change},

event(change) ->
  sleep(5000),...






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



CONFIDENTIALITY NOTICE

THE INFORMATION CONTAINED IN THIS COMMUNICATION IS INTENDED FOR THE NAMED RECEIVER ONLY. THE TRANSMISSION MAY CONTAIN PRIVILEGED AND CONFIDENTIAL MATERIAL. IF YOU ARE NOT THE NAMED RECIPIENT, PLEASE BE ADVISED THAT ANY USE, DISSEMINATION OR UNAUTHORIZED COPYING OF THE MATERIAL IS STRICTLY PROHIBITED. IF YOU HAVE RECEIVED THIS TRANSMISSION IN ERROR, PLEASE NOTIFY SUP...@TRUEEX.COM AND DESTROY THE RECEIVED COPY. THANK YOU.

Reply all
Reply to author
Forward
0 new messages