Allow event binding with functional ui attribute.

Address #957.