Hi Anton,
The #sync_panel{} relies on two levels of selectiveness when deciding when to trigger, so the content itself can be refreshed on a per-user, or per-role, or per-whatever basis. The two levels are the global comet pool and a list of triggers (which are messages that when the process receives a message, will trigger a refresh).
For example, say you run a system with multiple subdomains (where each subdomain points to a different database), and within there, each subdomain's database has multiple users with different classes, we'll say a "securitylevel" (like admin or non-admin).
You can retrieve the subdomain by calling wf:header(host) (returns the full host-header, "ala
mysite.mydomain.com"), and maybe you have a function usr:securitylevel() to retrieve the current user's securitylevel.
And let's say you only want a sync_panel to refresh for changes made within a subdomain and by the same securitylevel:
host_header() ->
wf:header(host).
pool_name() ->
{dashboard, host_header()}.
body() ->
MySecuritylevel=usr:securitylevel(),
#sync_panel{
pool=pool_name(),
triggers=[{update, MySecuritylevel}],
body_fun=draw_dashboard/0
}.
draw_dashboard() ->
...
Then when you want to refresh that list for those specific users, you would call:
element_sync_panel:refresh(pool_name(), {update, usr:securitylevel()}).
That would trigger the sync_panel to refresh for the users connected to only that one pool, and only the users with that securitylevel.
Make sense?