1

我在一个表中有两列,每列有一个复选框。

           <p:column headerText="#{msg['labels.ok']}" styleClass="center" style="width:40px;" id="acpCol">
                <p:selectBooleanCheckbox 
                    id="acpSel"
                    value="#{item.acept}"       
                    onchange="checkAcp(this);               
                    disabled="#{item.cancel}">
                </p:selectBooleanCheckbox>
            </p:column>

            <p:column headerText="#{msg['labels.cnx']}" styleClass="center" style="width:40px;" id="cnxCol" >
                <p:selectBooleanCheckbox
                    id="cnxSel" 
                    value="#{item.cancel}""
                    disabled="#{!item.acept}"
                    >
                </p:selectBooleanCheckbox>
            </p:column>

当第一个被选中以启用第二个时,我需要,但是使用 javascript,我没能做到。

4

1 回答 1

2

我认为您需要更新第二个,如下所示:

<p:column headerText="#{msg['labels.ok']}" styleClass="center" style="width:40px;" id="acpCol">
    <p:selectBooleanCheckbox id="acpSel" value="#{item.acept}" disabled="#{item.cancel}">
        <p:ajax update="cnxCol"/>  
    </p:selectBooleanCheckbox>
</p:column>
于 2013-09-06T11:40:26.810 回答