You must have an active conversation (or - not preferred - have everything in session scope) to have the beans in context. So at the moment you open your modalpanel without having the bean in scope, which results in a null-pointer error.
Add a begin annotation (if needed nested) on the viewInpopup() method.
The other thing is that you're NOT using a ajax-type link which which is also not adviceable. Change it to a Ajax-version link and use the
oncompletemethod to open the modalpanel.Additionally use the reRender attribute of that ajax-link to reRender the content of you modal panel.
Thanks for the response Leo.
For the moment what I did was change the requirement to open it as a new tab instead of new window(Hoping client may not disagree with that.). That way works fine.
If in case a pop-up would be requested I will try the things you have specified.