Hi Rohith,
As Praveen Mentioned above you nee to close the popup first, thats the reason you are getting the Error.
Do as follows to solve this,
In Event handler you shouln't directly navigate, Instead go to the outbound plug of window of your popup,
then from here call the method fire_outbound_plug.
Now from here you have 2 solutions One is to use navigation Link and Navigate to the Next Component, for this you can create a Navigation Link with same name as Outbound plug and pass it as parameter to fire_outbound_plug.
But since you are using Dynamic navigation I assume you are not doing it through COmponent Usage, so navigation Link is not possible. So write whatever code you have presently in Event Handler in the Outbound plug just after fire_outbound_plug call.
This will solve your Issue
Thanks and Regards,
Pratheek