单击listgrid记录中的复选框

时间:2014-11-25 13:12:00

标签: java gwt smartgwt

我正在使用SmartGWT,我有一个带有RecordClickHandler的listGrid,每条记录都包含一个复选框,

当我点击复选框时,RecordClickHandler适用,但这不是我想要的行为,

我希望复选框具有不同于其自身记录的行为,所以任何人都可以提供任何帮助吗?

onRecordClick body:

    public void onRecordClick(RecordClickEvent event) {
    final int recordNumber = event.getRecordNum();
    if(selectedJob == recordNumber) return;
    boolean changeSelectedEquipment = true;
    if(ClientFactoryImpl.isDirty()){
        int tabNum = jobsContentView.getJobTabSet().getSelectedTabNumber();
        switch (tabNum) {
        case 0:
            if(!jobsContentView.getJobsDetailsView().isValid()){
                event.cancel();
                changeSelectedEquipment = false;
                dropBoxWindowManager.showError(jobsViewVocabularies.unableToSave());
                jobsContentView.getJobTabSet().showErrorOnTab(tabNum, jobsViewVocabularies.unableToSave());
            }
            break;
        case 1:
            if(!jobsContentView.getJobsEquipmentUsedView().isValid()){
                event.cancel();
                changeSelectedEquipment = false;
                dropBoxWindowManager.showError(jobsViewVocabularies.unableToSave());
                jobsContentView.getJobTabSet().showErrorOnTab(tabNum, jobsViewVocabularies.unableToSave());
            }
            break;
        default:
            break;
        }
    }
    if(changeSelectedEquipment && ClientFactoryImpl.isDirty()){
        clientFactory.getJobsView().saveJobsView(null ,REDIRECTION_PLACE.TAB_CACHED, (((ListDataRow)(jobListGrid.getRecord(selectedJob))).getJobDetails().getJob().getJobId()));
        ((ListDataRow)jobListGrid.getRecord(selectedJob)).setIsCached(false);
    }
    if(changeSelectedEquipment){
        updateNewRecord(recordNumber);
    } else {
        jobListGrid.deselectRecord(recordNumber);
        jobListGrid.selectRecord(selectedJob);
    }
}

0 个答案:

没有答案