You need to alter your approach. Remove the code that tries to hide the fields from your OnLoad event. I presume you didn't use the rendered property (which wouldn't send the field in the first place) since you need it in some computations.
Go to the all properties panel of the field, locate the style property and enter a SSJS expression that computes visibility or display property.
Putting the calculation there will survive any refresh.
A sample:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:checkBox text="Control on" id="editMode"
value="#{viewScope.editMode}" checkedValue="true"
uncheckedValue="false" defaultChecked="true">
<xp:eventHandler event="onclick" submit="true"
refreshMode="partial" refreshId="SpreadSheetDsp">
</xp:eventHandler>
</xp:checkBox>
<xp:table style="width:100.0%" id="SpreadSheetDsp">
<xp:tr style="background-color : #FFBBBB">
<xp:this.rendered><![CDATA[#{javascript:"false" != viewScope.editMode;}]]></xp:this.rendered>
<xp:td>Visible</xp:td>
<xp:td>when checked</xp:td>
</xp:tr>
<xp:tr style="background-color : #BBBBFF">
<xp:this.rendered><![CDATA[#{javascript:"false" == viewScope.editMode;}]]></xp:this.rendered>
<xp:td>Visible</xp:td>
<xp:td>when unchecked</xp:td>
</xp:tr>
</xp:table>
</xp:view>
Hope that helps