Reputation: 1660
I have a check box that is disabled. I click a button that sets the value of that check box to be 'checked'. When I go to save, the check box loses its value. Anyone have any ideas? Here is a simple mockup:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view
xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.data>
<xp:dominoDocument
var="MainForm"
formName="MainForm" />
</xp:this.data>
<xp:checkBox
text="CheckBox"
id="CheckBox"
value="#{MainForm.CheckBox}"
disabled="true"
checkedValue="Y"
uncheckedValue="N">
</xp:checkBox>
<xp:br></xp:br>
<xp:button
id="setBc"
value="Set CheckBox">
<xp:eventHandler
event="onclick"
submit="true"
refreshMode="partial"
refreshId="CheckBox">
<xp:this.action><![CDATA[#{javascript:getComponent("CheckBox").setValue("Y");}]]></xp:this.action>
</xp:eventHandler>
</xp:button>
<xp:button
value="Save"
id="button5">
<xp:eventHandler
event="onclick"
submit="true"
refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:MainForm.save();}]]></xp:this.action>
</xp:eventHandler>
</xp:button>
</xp:view>
Upvotes: 0
Views: 1506
Reputation: 1
This could be a specific problem to Domino 8.5.3 (if that is what you are using). We have noticed that since we upgraded to 8.5.3 we get a problem (on normal classic domino pages) where fields tagged as "disabled" don't get saved down to the doc. We have had to build around this by not using a "proper" field that is disabled for values that has to later be saved. Another workaround was to remove the disabled setting before posting in the post script.
We are fairly sure this all started to happened with the release of 8.5.3
Upvotes: 0
Reputation: 21709
Disabled controls are not included in page submissions.
You can combine your disabled check box with a xp:inputHidden control which is a hidden input field that is included in page submissions.
Upvotes: 6