如何在选中或取消选中复选框后更新数据表值

时间:2015-07-21 06:24:29

标签: primefaces datatable

我有以下代码,当我选中复选框时,该值不会反映在dtWebVo.cpdCourseInfo [??]。chkSelect中。因为我想在db中获取值并进行更新。我该怎么办?

NSUInteger audioDurationSeconds = (long)CMTimeGetSeconds(audioDuration);
NSUInteger minutes = floor(audioDurationSeconds % 3600 / 60);
NSUInteger seconds = floor(audioDurationSeconds % 3600 % 60);
NSString *time = [NSString stringWithFormat:@"%02ld:%02ld", minutes, seconds];

2 个答案:

答案 0 :(得分:0)

<p:dataTable var="cpdCourseInfoDetail" tableStyle="width:auto" 
    value="#{dtWebVo.cpdCourseInfo}"
    rowKey="#{cpdCourseInfoDetail.selfInputCourseID}"
    rowIndexVar="index" selection="#{dtWebVo.selectedCPDCourseInfo}"
    id="gridCourseInfo"  styleClass="ui-edb-td-wrap-table ui-edb-header-style table-no-select-all" >
   <p:column id="x_checkbox" selectionMode="multiple" onload="disableCheckBox(this.id,#{cpdCourseInfoDetail.cpdStatusAction})"></p:column>

答案 1 :(得分:-1)

通过将以下内容添加到数据表标记中来修复。

<p:dataTable disabledSelection="#{car.color =='Black'}" ... >