I have a checkbox, with values or 0 and 1 for unchecked and checked.
I have a radio button, that when clicked, set's this to 0, which works correctly.
I disable fields on the form if this is unchecked.
However, when I check the checkbox, it reloads the page, and correctly enables the form, however the checkbox is no longer checked, so each subsequent refresh, disables the form. This is also true, opening a document. The checkbox is bound to the form, but even if the value on the backend form is 1, the box is not checked and the fields are not enabled. Any idea's? Checkbox code below, thanks:
EDIT: Just for clarity, chkDoNotShowAgain is the checkbox id and ConfirmedDeclaration is the name of the field it is bound to
<xp:checkBox id="chkDoNotShowAgain"
text="I confirm."
checkedValue="#{javascript:1}" uncheckedValue="#{javascript:0}"
value="#{document1.ConfirmedDeclaration}">
<xp:eventHandler event="onclick" submit="true"
refreshMode="partial" refreshId="refreshResponse">
<xp:this.action><![CDATA[#{javascript:try{
getComponent("chkDoNotShowAgain").setValue(1);
document1.replaceItemValue("ConfirmedDeclaration",1);
document1.replaceItemValue("Status","New");
var dt = new Date();
var arrHistory:array = AddObjectivesHistoryItem(currentDocument, dt, "Confirmed", userBean.displayName);
document1.save();
context.reloadPage()
}catch(e){
openLogBean.addError(e,this.getParent());
}
}]]></xp:this.action>
</xp:eventHandler>
</xp:checkBox>
Do You need the reloadPage? Have You tried it without reloading, just with partial refresh?
If it does not bother You, try to change the type of data stored in checkbox form number to String, I had some problems when tried to use the numbers in checkbox or radio in XPages.