Using events in widgets on server side