It's definitely true that a lot of wiring like that can indeed slow it
down in a browser with a slower javascript engine.
I do think the best solution is something like a hard wiring event,
maybe a hard_events attribute that can attempt to intelligently assign
events to html onclick attributes and the like.
An alternative you could try to use without reworking the nitrogen
elements is to use the #api element and then make the links with
directly typed links.
IE
body() ->
wf:wire(#api { name=my_postback, tag=links }),
[
"<a href=\"javascript:;\"
onclick=\"page.my_postback('link1')\">Link 1</a>",
"<a href=\"javascript:;\" onclick=\"page.my_postback('link2')\">Link 2</a>"
].
api_event(my_postback, links, Args) ->
do_something_with(Args).
That's at least a way to avoid having to deal with the slowdown of
that many links and all the generated javascript associated with
wiring events, though I admit it's not exactly the most
straightforward approach.
-Jesse
> --
> You received this message because you are subscribed to the Google Groups
> "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/nitrogenweb/-/G_FHgZo9b0MJ.
> 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
> For more options, visit this group at
> http://groups.google.com/group/nitrogenweb?hl=en.