How to trigger SQL Query on request?

A popup is its own view, so scope="view" certainly won't work. Use page scope.