彬彬学编程

效果:

代码:/**下拉条填充模板.*///@@endpublicjava.lang.StringfillDropDownList(com.sap.tc.webdynpro.progmodel.api.IWDAttributeInfoattributeInfo,java.util.Listv,java.lang.Stringlabel,booleanisShowDefault,booleanshowCodeWithDesc){//@@beginfillDropDownList()StringdefaultValue=null;ISimpleTypeModifiablemodifyType=attributeInfo.getModifiableSimpleType();modifyType.setFieldLabel(label);IModifiableSimpleValueSetvalueSet=modifyType.getSVServices().getModifiableSimpleValueSet();valueSet.clear();if(isShowDefault){valueSet.put("","");}if(v!=null){for(inti=0;i<v.size();i++){ValueSetItemitem=(ValueSetItem)v.get(i);if(defaultValue==null&&i==0){defaultValue=item.getId();}if(showCodeWithDesc){valueSet.put(item.getId(),item.getId()+""+item.getText());}else{valueSet.put(item.getId(),item.getText());}}}returndefaultValue;//@@end} //@@beginjavadoc:fillTranstate()/**运输状态下拉条填充.*///@@endpublicvoidfillTranstate(com.sap.tc.webdynpro.progmodel.api.IWDAttributeInfoattrinfo){//@@beginfillTranstate()Stringdefaultval="";Listdropdownlist=newArrayList();dropdownlist.add(newValueSetItem("0","计划"));dropdownlist.add(newValueSetItem("1","完成计划"));dropdownlist.add(newValueSetItem("2","登记"));dropdownlist.add(newValueSetItem("3","装载开始"));dropdownlist.add(newValueSetItem("4","装载结束"));dropdownlist.add(newValueSetItem("5","装运完成"));dropdownlist.add(newValueSetItem("6","装运开始"));dropdownlist.add(newValueSetItem("7","装运终止"));defaultval=fillDropDownList(attrinfo,dropdownlist,attrinfo.getName(),true,false);//@@end}

把上面两个方法写在Component Controller或Custom Controller上,,然后在对应的View上直接调用即可。

头脑心灵再加上双脚的才是推销员。

彬彬学编程

相关文章:

你感兴趣的文章:

标签云: