handler for widgetclick, modified template to avoid multiple handler calls