You need to add return false;
like this :
onclick="requestFullScreen(document.body);return false;"
to stop propagation of the click, and so stop the form submit.
Not related :
You don't need a <h:commandButton />
if you are not using any JSF functionnality. A simple <input type="button" onclick="..." />
. This is only a matter of slighly better performance. You can use plain HTML in JSF. This is about the same for <h:panelGroup />
, I don't abuse them, when not necessary I'll use <span />
or <div />