Hi bkvs,
Usually when you click the "Cancel" button that means you don't want to save your entry... hence displaying the dataloss popup doesn't make really sense to me. However, you may want the user to confirm that he really wants to cancel.
So I would suggest to redefine the EH_ON_CANCEL method of your view, to display a simple confirmation popup before you actually cancel everything. This wiki will show you how to do it:
Creating popup message in webclient UI - CRM - SCN Wiki
Regards,
Nicolas.