Thank you for your reply. In the meantime, I had the idea of redesigning the customer portal so that no page refresh would be necessary, but the problem still persists after the redesign, so I was mistaken and will have to use the method you described.