Use getView() instead of ctx in Resource widget