Here is a fairly minimal example:
-module(test).
-include_lib ("nitrogen/include/wf.hrl").
-compile(export_all).
main() -> #template{file="./site/templates/template.html"}.
body() ->
PanelId=wf:temp_id(),
[#link{text="Add", postback={add, PanelId}},
#panel{id=PanelId}].
event(click) ->
io:format("click~n");
event({add, PanelId}) ->
Id = wf:temp_id(),
wf:wire(Id, #event{type=click, postback=click}),
wf:update(PanelId, #link{id=Id, text="Click"}).
In Nitrogen 1.0, if you click Add and then Click, the server
prints "click".
In Nitrogen 2.0, the postback is no longer triggered in this
case, though I think we would expect it to be.
Instead we can do
event({add, PanelId}) ->
wf:update(PanelId, #link{text="Click", actions=#event{type=click, postback=click}}).
And it does work in Nitrogen 2.0. The two should function
equivalently, though.