How can I show information from external processes in N2O framefork.
Code like this:
tokyoWeather() ->
timer:sleep(10000),
Data = getTokyoWeater(),
??? SHOW_ON_PAGES,
tokyoWeather().
lisbonWeather() ->
timer:sleep(10000),
Data = getLisbonWeater(),
??? SHOW_ON_PAGES,
lisbonWeather().
Page1:
body() ->
[ #panel { id=TokyoWeather text= <<>> },
#panel { id=LisbonWeather, text= <<>> },
...].
Page2:
body() ->
[ #panel { id=TokyoWeather text= <<>> },
#panel { id=LisbonWeather, text= <<>> },
...].
Thanks in advance.
Use wf:reg and wf:flush functions. Example: /samples/apps/review/src/index.erl
Register unique name for a page-process:
23:
event(init) -> wf:reg(room)...Updating DOM:
60:
wf:insert_bottom(history, Terms)Flushing changes to browser using page-process name:
62:
wf:flush(room)