保存后,禁用复选框会丢失值

Rya*_*ing 0 xpages

我有一个禁用的复选框.我单击一个按钮,将该复选框的值设置为"已选中".当我去保存时,复选框丢失了它的值.有人有主意吗?这是一个简单的模型:

<?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>
Run Code Online (Sandbox Code Playgroud)

Per*_*ten 6

页面提交中不包括已禁用的控件.

您可以将禁用的复选框与xp:inputHidden控件组合使用,该控件是页面提交中包含的隐藏输入字段.