Allow event binding with functional ui attribute.

fixes #957.