icefaces定制的dojo data grid

阅读更多
icefaces定制的dojo data grid

页面代码




xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:dojo="http://www.icefaces.org/icefaces-ext/dojo/component"
xmlns:yui="http://www.icefaces.org/icefaces-ext/yui/component">


value="#{facesContext.externalContext.requestContextPath}" />



value="#{commonSearchBean.manufacturerId}" /> id="antiSearchBom"
actionListener="#{commonSearchBean.antiSearchBom}" /> action="#{commonSearchBean.editSetup}" id="editSetup" />



actionListener="#{commonSearchBean.download}" />



id="searchModel" selectable="true" identifier="manufacturerId"
canSort="foo" width="100em" height="43.5em"
value="#{commonSearchBean.dataList}">




value="#{msg['materialCode']}"
rendered="#{queryFieldSelectionBean['materialCode']}" />
value="#{msg['manufacturerCode']}" width="12"
rendered="#{queryFieldSelectionBean['manufacturerCode']}" />
value="#{msg['catName']}" />
rendered="#{roles['engineer'] or roles['researcher']}" value="#{msg['dataMaintain']}"
field="dataMaintain" />

value="#{msg['antiSearch']}" field="antiSearch" />




value="#{msg['manufacturerName']}"
rendered="#{queryFieldSelectionBean['manufacturerName']}" />
value="#{msg['qualityStatusLevel']}"
rendered="#{queryFieldSelectionBean['qualityStatusLevel']}" />
value="#{msg['qualityStatusLevelDesc']}"
rendered="#{queryFieldSelectionBean['qualityStatusLevelDesc']}" />

width="40" rendered="#{queryFieldSelectionBean['description']}" />
rendered="#{queryFieldSelectionBean['rohsAuthentication']}"
value="#{msg['rohsAuthentication']}" />
formatter="true"
rendered="#{queryFieldSelectionBean['erpStatus']}" />


rendered="#{queryFieldSelectionBean['annualStock']}" />
rendered="#{queryFieldSelectionBean['annualReject']}" />

rendered="#{queryFieldSelectionBean['model']}" />
rendered="#{queryFieldSelectionBean['functionDesc']}" />
value="#{msg['acknowledgmentAuthor']}"
rendered="#{queryFieldSelectionBean['acknowledgmentAuthor']}" />
value="#{msg['acknowledgmentVersion']}"
rendered="#{queryFieldSelectionBean['acknowledgmentVersion']}" />
rendered="#{queryFieldSelectionBean['edeNum']}" />
value="#{msg['firstUsedOccasion']}"
rendered="#{queryFieldSelectionBean['firstUsedOccasion']}" />
rendered="#{queryFieldSelectionBean['customVersion']}" />
value="#{msg['softwareVersion']}"
rendered="#{queryFieldSelectionBean['softwareVersion']}" />
rendered="#{queryFieldSelectionBean['reliability']}" />
value="#{msg['maintainReject']}"
rendered="#{queryFieldSelectionBean['maintainReject']}" />
value="#{msg['securityAuthentication']}"
rendered="#{queryFieldSelectionBean['securityAuthentication']}" />
value="#{msg['otherAuthentication']}"
rendered="#{queryFieldSelectionBean['otherAuthentication']}" />
value="#{msg['jointingDemand']}"
rendered="#{queryFieldSelectionBean['jointingDemand']}" />
rendered="#{queryFieldSelectionBean['coat']}" />
rendered="#{queryFieldSelectionBean['cleanDemand']}" />
rendered="#{queryFieldSelectionBean['msdLevel']}" />
rendered="#{queryFieldSelectionBean['lifeEndDay']}" />
rendered="#{queryFieldSelectionBean['lifeEndDay']}" />
rendered="#{queryFieldSelectionBean['stockCycle']}" />
rendered="#{queryFieldSelectionBean['perform']}" />
rendered="#{queryFieldSelectionBean['service']}" />
rendered="#{queryFieldSelectionBean['remark']}" />











##### js代码,reRender formatter="true"的列
// search model data grid
antiSearchBom = function(materialCode, flag) {
    var param = '?materialCode=' + materialCode + '&flag=' + flag;
    // $('frmCommonSearch:antiSearchBom').click();
    Common.open('/ppl/viewBom' + param);
}

paramDetail = function(manufacturerId, catId) {
    var param = '?manufacturerId=' + manufacturerId;
    // alert(param);
    // $('frmCommonSearch:antiSearchBom').click();
    Common.open('/ppl/viewParam' + param);
}

searchModel_materialCode = function(value, rowIndex) {
    var dataItem = dijit.byId('searchModel').getItem(rowIndex);
    var manufacturerId = dataItem.manufacturerId;
    return "    + manufacturerId + "');return false;\" href=\"javascript:;\">"
    + value + "
";

}

searchModel_componentAntiSearch = function(value, rowIndex) {
    var dataItem = dijit.byId('searchModel').getItem(rowIndex);
    var materialCode = dataItem.materialCode;
    return "    + materialCode
    + "','component');return false;\" href=\"javascript:;\">"
    + value
    + "
";

}
searchModel_dataMaintain = function(value, rowIndex) {
    var dataItem = dijit.byId('searchModel').getItem(rowIndex);
    var manufacturerId = dataItem.manufacturerId;
    return "    + manufacturerId + "');return false;\" href=\"javascript:;\">"
    + value + "
";

}
searchModel_antiSearch = function(value, rowIndex) {
    var dataItem = dijit.byId('searchModel').getItem(rowIndex);
    var id = dataItem.id;
    var materialCode = dataItem.materialCode;

    var component = "    + materialCode
    + "','component');return false;\" href=\"javascript:;\">"

    + "组件反查
";

    var deviceType = "    + materialCode
    + "','deviceType');return false;\" href=\"javascript:;\">"

    + "机型反查
";

    return component + '     |     '
    + deviceType;
}
searchModel_deviceTypeAntiSearch = function(value, rowIndex) {
    var dataItem = dijit.byId('searchModel').getItem(rowIndex);
    var materialCode = dataItem.materialCode;
    return "    + materialCode
    + "','deviceType');return false;\" href=\"javascript:;\">"
    + value
    + "
";
}

searchModel_rohsAuthentication = function(value, rowIndex) {
    var dataItem = dijit.byId('searchModel').getItem(rowIndex);
    // var rohs = dataItem.rohsAuthentication;
    if (value == '00' || value == 'R2') {
        // 取消冻结
        value = '是';
    } else if (value == '') {
        value = '';
    } else {
        // 冻结
        value = '否';
    }
    return value;

}

searchModel_erpStatus = function(value, rowIndex) {
    var dataItem = dijit.byId('searchModel').getItem(rowIndex);
    // var rohs = dataItem.rohsAuthentication;

    if (value == '00' || value == 'R2') {
        // 取消冻结
        value = '可采购';
    } else if (value == '') {
        value = '';
    } else {
        // 冻结
        value = '不可采购';
    }
    return value;

}

searchModel_catName = function(value, rowIndex) {

    var dataItem = dijit.byId('searchModel').getItem(rowIndex);
    var materialCode = dataItem.materialCode;

    var manufacturerId = dataItem.manufacturerId;
    // var catId = dataItem.catId;
    // if (catId == '' || catId == 'null') {
    // catId == 0;
    // }

    var catName = dataItem.catName;
    // alert(manufacturerId + "--- " + catName);
    if (value == undefined) {
        value = '';
    }
    // var target = "/ppl/viewParam?manufacturerId=" + manufacturerId
    // + "&catName=" + catName;
    return "    + manufacturerId + "');return false;\" href=\"javascript:;\">"
    + value + "
";
}

searchModel_edeNum = function(value, rowIndex) {
    var dataItem = dijit.byId('searchModel').getItem(rowIndex);
    var edeNum = dataItem.edeNum;
    if(edeNum=='null'||edeNum==undefined){
        edeNum='';
    }
    return "    + edeNum+ "');return false;\" href=\"javascript:;\">"
    + edeNum + "
";

}

######
back bean 里的render方法,在render前这个方法会被执行
    public void searchModelRender() {
        dataList = serviceLocator.getSearchedModelService().getSearchModel(
                commonSearchDto.getWhereSql(), pagingConfig);

    }

你可能感兴趣的:(Dojo,Bean,XHTML,XML,HTML)