Only try to count if the contentPane has a URL
Refactor countAction for model searches