Fix @ItemClick and parametrized types

This PR fixes the issue #504 implementing things suggested to the PR #570.