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>