0
votes

On my XPages form I have a checkbox control:

<xp:checkBox 
        id="cbPromo"
        value="#{employeeBean.employee.promoCheck}"
        valueChangeListener="#{employeeBean.onPromotChange}"
        checkedValue="true" 
        uncheckedValue="false"
        disabled="#{!employeeBean.employee.editable}">
        <xp:eventHandler 
            event="onclick" 
            submit="true"
            refreshMode="partial" 
            refreshId="pnlUpdate" 
            execMode="partial" />
    </xp:checkBox>
</xp:panel>

The problem is when I change the edit mode for the employee object (default is editable = false) the checkbox control which was in read mode checked becomes unchecked.

When I add a computed text control to see what the value for the promoCheck field its is both in read and edit mode true:

<xp:text escape="true" id="computedField1"
    value="#{employeeBean.employee.promoCheck}">
</xp:text>

Can someone explain me what I should do to keep the checkbox control checked when I switch the editable mode for my employee object?

1

1 Answers

4
votes

don't use the disabled property, but the readonly property instead