The securing & supporting is covered in 334.30 and I see nothing there that specifically allows this type of installation.
However, an inspector can accept other methods (90.4 second paragraph). If I was inspecting, I would want some substantiation that the foam would not harm the cable (110.11).